Created
June 16, 2014 16:28
-
-
Save Fosome/d88343d3e19fe45a516a to your computer and use it in GitHub Desktop.
This file contains 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 ParentFoo | |
def foo | |
_foo | |
end | |
private | |
def _foo | |
puts "parent private foo" | |
end | |
end | |
class ChildFoo < ParentFoo | |
def foo | |
super | |
end | |
private | |
def _foo | |
puts "child private foo" | |
end | |
end | |
ChildFoo.new.foo | |
#=> child private foo | |
#=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment