Created
January 28, 2014 01:11
-
-
Save imogenkinsman/8660653 to your computer and use it in GitHub Desktop.
define_method example
This file contains 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
2.1.0 :013 > String.send(:define_method, :awesome) { "#{self} is awesome!" } | |
=> :awesome | |
2.1.0 :014 > "Ruby".awesome | |
=> "Ruby is awesome!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment