如何在继承链中选择特定的 a 方法调用?
class A
def boo; puts "A:Boo"; end
end
class B < A
def boo; super; puts "B:Boo"; end
end
class C < B
def boo; self.A.boo(???); puts "C:Boo"; end
end
因此输出将是 A:Boo, C:Boo
TIA,
-丹尼尔
如何在继承链中选择特定的 a 方法调用?
class A
def boo; puts "A:Boo"; end
end
class B < A
def boo; super; puts "B:Boo"; end
end
class C < B
def boo; self.A.boo(???); puts "C:Boo"; end
end
因此输出将是 A:Boo, C:Boo
TIA,
-丹尼尔