Skip to content

Instantly share code, notes, and snippets.

@imogenkinsman
Created January 28, 2014 01:11
Show Gist options
  • Save imogenkinsman/8660653 to your computer and use it in GitHub Desktop.
Save imogenkinsman/8660653 to your computer and use it in GitHub Desktop.
define_method example
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