Created
June 17, 2015 11:26
-
-
Save karledurante/407eb172079e75aec2d5 to your computer and use it in GitHub Desktop.
No private inner class in ruby!
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 method_one | |
"A: method_one" | |
end | |
private | |
class B | |
def method_one | |
"A::B: method_one" | |
end | |
end | |
end | |
class C < A::B | |
def method_one | |
"C: method_one" | |
end | |
end | |
> c = C.new | |
=> #<C:0x007fe94487b358> | |
> c.method_one | |
=> "C: method_one" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment