Skip to content

Instantly share code, notes, and snippets.

@eric
Forked from joevandyk/private class methods.rb
Created November 10, 2008 19:58
Show Gist options
  • Save eric/23600 to your computer and use it in GitHub Desktop.
Save eric/23600 to your computer and use it in GitHub Desktop.
class Foo
private
def self.hello
puts "hi"
end
end
Foo.hello # => "hi"
class Bar
class << self
private
def hello
puts "yoh"
end
end
end
Bar.hello # => private method `hello' called for Bar:Class (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment