Skip to content

Instantly share code, notes, and snippets.

@caius
Created December 7, 2011 18:25
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 caius/1443973 to your computer and use it in GitHub Desktop.
Save caius/1443973 to your computer and use it in GitHub Desktop.
class Foo
class << self
protected
def foo
:foo
end
end
class Bar
class << self
public
def bar
Foo.foo
end
end
end
end
Foo::Bar.bar # => :foo
Foo.foo # =>
# ~> -:20: protected method `foo' called for Foo:Class (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment