Created
September 5, 2018 17:23
-
-
Save patmaddox/100ac01819798abcb761f4adcc6af45f to your computer and use it in GitHub Desktop.
module madness
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
module Foo | |
def baz | |
"I am from foo!" | |
end | |
end | |
module Bar | |
def baz | |
"I am from bar!" | |
end | |
end | |
class FooBar | |
include Foo | |
include Bar | |
end | |
class BarFoo | |
include Bar | |
include Foo | |
end | |
raise "uh-oh" unless FooBar.new.baz == "I am from bar!" | |
raise "uh-oh" unless BarFoo.new.baz == "I am from foo!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment