2
美好的一天,我是新来的红宝石。我想知道如何从一个子类的方法运行父方法? 在java中它会像从孩子::方法调用父::方法
class Child
..
def something_else
super.something
end
end
,并在PHP
parent::method_name();
你能告诉我该怎么做在Ruby中? 只发现了这一点,它使用alias_method_chain
看看这个:http://stackoverflow.com/questions/1251178/calling-another-method-in-super-class-in-ruby –
是的,谢谢你。我希望红宝石可以做得比这更好,因为它不像其他的ruby那样高雅 – Elmor