Skip to content

Instantly share code, notes, and snippets.

@jdunphy
Created February 4, 2009 20:51
Show Gist options
  • Save jdunphy/58336 to your computer and use it in GitHub Desktop.
Save jdunphy/58336 to your computer and use it in GitHub Desktop.
$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