Skip to content

Instantly share code, notes, and snippets.

@MarkMenard
Created November 15, 2009 02:36
Show Gist options
  • Save MarkMenard/234939 to your computer and use it in GitHub Desktop.
Save MarkMenard/234939 to your computer and use it in GitHub Desktop.
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