Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created September 5, 2018 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmaddox/100ac01819798abcb761f4adcc6af45f to your computer and use it in GitHub Desktop.
Save patmaddox/100ac01819798abcb761f4adcc6af45f to your computer and use it in GitHub Desktop.
module madness
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