Created
April 23, 2009 17:24
-
-
Save patmaddox/100613 to your computer and use it in GitHub Desktop.
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
# The goal is to make classes who include Foo also get the methods | |
# from Bar, but after Foo has already been included | |
module Foo | |
def foo; end | |
end | |
class FooBar | |
include Foo | |
end | |
module Bar | |
def bar; end | |
end | |
module Foo | |
include Bar | |
end | |
FooBar.new.foo # => nil | |
FooBar.new.bar # => NoMethodError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment