I have an old function that is called many times in my application. I would like to update it a bit, which involves adding some new arguments.
When I wrote the function, I did not understand the benefits has making a hash the only parameter (mentioned here: http://www.skorks.com/2009/08/more-advanced-ruby-method-arguments-hashes-and-blocks/)
I have:
def old_function(some_arg)
puts some_arg
end
I'd like to rewrite this to take a hash like so:
def old_function(some_arg, hash)
puts hash[:new_stuff] + "--" + some_arg
end
All while this does not break:
puts old_function('greetings')