Created
April 29, 2013 03:17
-
-
Save aasmith/5479530 to your computer and use it in GitHub Desktop.
An even more "exciting" way to define configuration-style class methods!
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 lol(n) | |
Module.new { define_method(:hoho) { n } } | |
end | |
class Bar | |
extend lol 123 | |
end | |
Bar.hoho # => 123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment