Last active
January 7, 2019 18:56
-
-
Save havenwood/5692bc5667d419b1bbf31d92663c4bb6 to your computer and use it in GitHub Desktop.
response to catbusters' question on #ruby irc
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
class Foo | |
def self.foo | |
bar | |
end | |
private_class_method def self.bar | |
:bar | |
end | |
end | |
Foo.foo | |
#=> :bar | |
Foo.bar | |
#!> NoMethodError: private method `bar' called for Foo:Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment