Skip to content

Instantly share code, notes, and snippets.

@tagomoris
Created April 16, 2014 06:18
Show Gist options
  • Save tagomoris/10815724 to your computer and use it in GitHub Desktop.
Save tagomoris/10815724 to your computer and use it in GitHub Desktop.
class A
end
class B < A
end
A.define_singleton_method(:foo){ "foo" }
A.foo #=> "foo"
B.foo # NoMethodError
class A
end
A.define_singleton_method(:foo){ "foo" }
class B < A
end
A.foo #=> "foo"
B.foo #=> "foo" !!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment