wilson (owner)

Revisions

gist: 211910 Download_button fork
public
Public Clone URL: git://gist.github.com/211910.git
Embed All Files: show embed
blah.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
obj = "something"
method_name = "foo"
obj.instance_eval <<-CODE
def #{method_name}
"blah"
end
CODE
 
# ... or..
 
class << obj
  define_method(method_name) do
    "blah"
  end
end