Created
November 15, 2009 02:36
-
-
Save MarkMenard/234939 to your computer and use it in GitHub Desktop.
This file contains 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
class Foo | |
# This way of calling define_method works. | |
define_method(:bar) do | |
puts self | |
end | |
# This fails saying define_method is a private method. | |
# Why, when self is obviously the object receiving the define_method message...? | |
self.define_method(:foo) do | |
puts self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment