Created
April 16, 2013 20:07
-
-
Save bayleedev/5399170 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
private | |
def self.bar | |
puts 'I broke your ruby' | |
end | |
end | |
Foo.bar # I broke your ruby |
Author
bayleedev
commented
Apr 16, 2013
class Foo
class << self
def barbaz
class << self; self; end
end
protected
def bar
puts 'hello'
end
end
end
Foo.barbaz.send(:public, :bar)
Foo.bar
class Foo
class << self
protected
def bar
puts 'hello'
end
end
end
Foo.send(:public_class_method, :bar)
Foo.bar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment