Skip to content

Instantly share code, notes, and snippets.

@kitsuneyo
Created August 19, 2017 06:47
Show Gist options
  • Save kitsuneyo/96920921c0791d1a4abd2a8296b15d76 to your computer and use it in GitHub Desktop.
Save kitsuneyo/96920921c0791d1a4abd2a8296b15d76 to your computer and use it in GitHub Desktop.
def class_keywords
const_name = self.class.to_s.parameterize(separator: '_').upcase
"Metatag::Keywords::#{const_name}".try(:constantize)
end
# returns NameError: uninitialized constant Metatag::Keywords::WHERE_UNDEFINED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment