Created
June 5, 2011 01:41
-
-
Save jpignata/1008564 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 A | |
def protected_method | |
puts "success" | |
end | |
protected :protected_method | |
end | |
class B < A | |
def public_method | |
puts "B" | |
A.new.protected_method | |
end | |
end | |
class C | |
def public_method | |
puts "C" | |
A.new.protected_method | |
end | |
end | |
B.new.public_method | |
C.new.public_method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment