Skip to content

Instantly share code, notes, and snippets.

@andys
Created July 6, 2012 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andys/3058918 to your computer and use it in GitHub Desktop.
Save andys/3058918 to your computer and use it in GitHub Desktop.
class Parent
def add(x,y)
x + y
end
end
class Child < Parent
def add
super
end
end
Child.new.add(1,2)
# ArgumentError: wrong number of arguments (2 for 0)
@damncabbage
Copy link

class Child < Parent
  def add(*args)
    super
  end
end

Child is whinging that you're not giving it enough arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment