It’s unusual that a mistake actually works in my favor. So, I was pleasantly surprised to see my tests passing when I forgot to pass the arguments from a child’s method implementation to the parent’s. Let’s look at an example.
class Parent def putz(*args) puts "calling puts from parent" puts(args) end end class Child < Parent def putz(*args) super end end
Since no arguments are explicitly passed to the super call in the the child class’s putz method, Ruby will implicitly pass all the arguments received in the child method.
Child.new.putz('foo', 'bar', 'baz') calling puts from parent foo bar baz => nil
More information on how super behaves can be found here.