-
-
Save havenwood/32dd791c5bb51080f340f016cfc0eee8 to your computer and use it in GitHub Desktop.
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 | |
module_function def foo | |
:foo | |
end | |
end | |
class Bar | |
include Foo | |
end | |
Bar.new.foo | |
#!> NoMethodError: private method `foo' called for #<Bar:0x00007fe909ae8f40> | |
class Baz | |
include Foo | |
public :foo | |
end | |
Baz.new.foo | |
#=> :foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment