Last active
October 11, 2016 18:46
-
-
Save floehopper/59b3ae48520f6ba5e306219d84e85f3d to your computer and use it in GitHub Desktop.
Calling Object#method hangs for private method defined on module then made public once it's been used to extend class
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
module Foo | |
private | |
def foo | |
"foo" | |
end | |
end | |
class Bar | |
extend Foo | |
class << self | |
public :foo | |
end | |
end | |
Bar.foo # => "foo" | |
Bar.method(:foo) # => #<Method: Class(Bar)#foo> | |
module Baz | |
end | |
class Bar | |
class << self | |
prepend Baz | |
end | |
end | |
Bar.method(:foo) # => hangs! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK
Hangs