Created
July 27, 2011 14:14
-
-
Save coffeeaddict/1109439 to your computer and use it in GitHub Desktop.
Will it blend?
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 bar | |
puts "Hello" | |
end | |
class Panel | |
end | |
class View < Panel | |
def foo | |
bar | |
end | |
end | |
class Pane | |
end | |
end | |
module Other | |
include Foo | |
class MyView < View | |
def quex | |
p = Pane.new | |
end | |
end | |
end | |
o = Other::MyView.new | |
o.quex | |
# it wil complain that Pane is not available: | |
# poc.rb:24:in `quex': uninitialized constant Other::MyView::Pane (NameError) | |
# from poc.rb:30 | |
# | |
# didn't see that comin' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment