Last active
October 9, 2018 00:48
-
-
Save aristotelesbr/c0a9505b36af9866e050591f901b27e9 to your computer and use it in GitHub Desktop.
Example for post (working with modules from Ruby)
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 foo | |
'foo' | |
end | |
def bar | |
'bar' | |
end | |
end | |
class B < A | |
def foo | |
super + 'bar' | |
end | |
end | |
B.new.bar | |
# => "bar" | |
puts B.new.foo | |
# => foobar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment