Skip to content

Instantly share code, notes, and snippets.

@mperham
Created January 2, 2010 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperham/267319 to your computer and use it in GitHub Desktop.
Save mperham/267319 to your computer and use it in GitHub Desktop.
s1 = String.new 'foobar'
s2 = String.new 'test'
meth = 'mike'
s1.instance_eval <<-EOM
def #{meth}
puts "Hello World"
end
EOM
s1.mike
s2.mike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment