Created
February 4, 2009 20:51
-
-
Save jdunphy/58336 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
$irb | |
irb(main):001:0> self.instance_eval "def method_missing(sym); sym.to_s; end" | |
=> nil | |
irb(main):002:0> String.class_eval 'def method_missing(sym); "#{self} #{sym.to_s}"; end' | |
=> nil | |
irb(main):003:0> i.love.cookies! | |
=> "i love cookies!" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment