I am trying to access a module function that I have overriden in the class.
module Base
def Hello
puts "Hello"
end
end
class Top
include Base
def Hello
puts "hello from top"
end
def Hi
if p == 1
Hello
else
Base::Hello
end
end
end
But I get the following error -
Error: undefined method `Hello' for Base:Module
Is there any way I can access the module function without using self.Hello in function definition.
self.preceding it) then inside the class that includes the module it can be accessed as if it were an instance variable, that is, withoutself. I think what the OP means is that he does not want to define the method withself. But then I want to ask the OP, why is it that you don't want to define the method withself.? If you override the method in the class, you'll have to refer to it in some special way.