Last active
December 21, 2015 02:49
-
-
Save imogenkinsman/6237718 to your computer and use it in GitHub Desktop.
example of a super call
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 A | |
def my_func(str) | |
puts str | |
end | |
end | |
class B < A | |
def my_func(str) | |
puts str | |
super("called from B#my_func") | |
end | |
end | |
b = B.new | |
b.my_func("test") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment