Created
August 15, 2019 20:10
-
-
Save sbellware/75dd3eea9186d01841bf7d26e605cbea to your computer and use it in GitHub Desktop.
UnboundMethod owner points to base class
This file contains hidden or 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 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