1
我知道如果你在Ruby中使用super,它意味着调用父类的方法。这里超级意思是什么?
但一些代码,我看到这一点:
def self.post(*args); handle_response super end
我不知道什么超级意思吗?
我知道如果你在Ruby中使用super,它意味着调用父类的方法。这里超级意思是什么?
但一些代码,我看到这一点:
def self.post(*args); handle_response super end
我不知道什么超级意思吗?
super
调用超类方法;所以super
返回超类方法返回的内容。
这里调用超类上定义的post
方法,并将其返回值传递给handle_response
方法。