Ruby 超级在这里是什么意思?
我知道如果在Ruby中使用super,就意味着调用父级的相同方法 但在一些代码中,我看到:Ruby 超级在这里是什么意思?,ruby,Ruby,我知道如果在Ruby中使用super,就意味着调用父级的相同方法 但在一些代码中,我看到: def self.post(*args); handle_response super end 我想知道super在这里是什么意思?super调用超类方法;因此super返回超类方法返回的内容 这里,调用在超类上定义的post方法,并将其返回值传递给handle\u response方法 super调用超类方法;因此super返回超类方法返回的内容 这里,调用在超类上定义的post方法,并将其返回值传递
def self.post(*args); handle_response super end
我想知道super在这里是什么意思?
super
调用超类方法;因此super
返回超类方法返回的内容
这里,调用在超类上定义的
post
方法,并将其返回值传递给handle\u response
方法 super
调用超类方法;因此super
返回超类方法返回的内容
这里,调用在超类上定义的post
方法,并将其返回值传递给handle\u response
方法