$VERBOSE = true
class Super
def foo
:super_foo
end
def bar
:super_bar
end
end
class Sub < Super
def foo
p __callee__ #=> :bar
p __method__ #=> :foo
p super #=> :super_foo
end
alias_method :bar, :foo
end
Sub.new.bar
:super_bar
返しそうな気がふっとしたので、一応確認しておいた。