-
-
Save kunzmann/1471853 to your computer and use it in GitHub Desktop.
super from ROROsyd
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
module Baz | |
def hello | |
"baz " + super | |
end | |
end | |
module Bar | |
def hello | |
"bar " | |
end | |
end | |
class Foo | |
include Bar | |
include Baz | |
end | |
Foo.new.hello # => "baz bar " | |
# vs | |
module Baz | |
def hello | |
"baz " + super | |
end | |
end | |
class Foo | |
def hello | |
"bar " | |
end | |
include Baz | |
end | |
Foo.new.hello # => "bar " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment