Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active January 7, 2019 18:56
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 havenwood/5692bc5667d419b1bbf31d92663c4bb6 to your computer and use it in GitHub Desktop.
Save havenwood/5692bc5667d419b1bbf31d92663c4bb6 to your computer and use it in GitHub Desktop.
response to catbusters' question on #ruby irc
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