Tuesday, April 5, 2011

What does super mean here?

I know that if you use super in Ruby it means call the parent's same method.

But in some code I see this:

def self.post(*args); handle_response super end

I wonder what the super means here?

From stackoverflow
  • super invokes the superclass method; so super returns what the superclass method returns.

    Here, the post method defined on the superclass is invoked and its return value is passed on to the handle_response method.

0 comments:

Post a Comment