Skip to content

Instantly share code, notes, and snippets.

@karledurante
Created June 17, 2015 11:26
Show Gist options
  • Save karledurante/407eb172079e75aec2d5 to your computer and use it in GitHub Desktop.
Save karledurante/407eb172079e75aec2d5 to your computer and use it in GitHub Desktop.
No private inner class in ruby!
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