nemlet
1/11/2009 8:35:00 PM
Here is an example.
#!/usr/bin/ruby
class A
end
class A::B
def method_one
x = C.new
puts x.blah
end
end
class A::C
def blah
puts "I want this one"
end
end
class C
def blah
puts "this is the wrong one"
end
end
ab = A::B.new
ab.method_one
As you can see when you run it you get the blah out of ::C NOT A::C
which I was expecting. Is there a way to be able to say C.new inside
of A::B and have it check the A:: Namespace first?