Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created August 15, 2019 20:10
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 sbellware/75dd3eea9186d01841bf7d26e605cbea to your computer and use it in GitHub Desktop.
Save sbellware/75dd3eea9186d01841bf7d26e605cbea to your computer and use it in GitHub Desktop.
UnboundMethod owner points to base class
class SomeClass
def some_method
end
end
C = Class.new(SomeClass)
m = C.instance_method(:some_method)
pp m.owner
# => SomeClass
# I would have expected the owner to be C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment