Created
August 19, 2017 06:47
-
-
Save kitsuneyo/96920921c0791d1a4abd2a8296b15d76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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