Last active
August 29, 2015 14:04
-
-
Save dliggat/283bdc15043bb09c7d51 to your computer and use it in GitHub Desktop.
Module function collision => super calls most recent definition
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 Foo | |
def blar | |
puts 'blar!' | |
end | |
end | |
module Bar | |
def blar | |
puts 'barry!' | |
end | |
end | |
class Flab | |
include Foo | |
include Bar | |
def blar | |
super | |
puts 'floob' | |
end | |
end | |
puts Flab.new.blar | |
# $ ruby ./mixin.rb | |
# barry! | |
# floob |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment