-
-
Save agrimm/1471899 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 | |
puts "Baz#hello called" | |
super | |
end | |
end | |
class Foo | |
def hello | |
puts "Foo#hello called" | |
super | |
end | |
include Baz | |
end | |
Foo.new.hello | |
Foo#hello called | |
Baz#hello called | |
NoMethodError: super: no superclass method `hello' for #<Foo:0x000001010159a8> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment