How can I delegate the invocations within a baseclass to the base class implementation rather than the inherited class implementation? For example:
class A
def foo
p "hello"
end
def bar
foo
end
end
class B < A
def foo
p "world"
end
end
A.new.bar
# prints "hello"
B.new.foo
# prints "world"
B.new.bar
# prints "world"
# the function should print "hello" instead
In the example above, what is the most elegant way to print hello when the foo method is invoked within the base class by bar method?