From: Greg Hauptmann Date: 2007-04-12T22:05:59+09:00 Subject: method signature - do I use named parameters OR pass a hash for flexibility/readability??? ------=_Part_7124_26003725.1176383156505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, What is the best practice in Ruby regarding creating methods? Is it to create a named set of parameters to pass (specific method signature) OR should I be passing a hash which may be more readable/future proof? For example: Option 1 - Named - def this_method (time, search_string, something_else) - a = this_method (11, "asdf", "asdf asdfa") Option 2 - Hash - def this_method (params) - a = this_method (:time => 11, :search_string => "asdf", :something_else => "asdf asdfa") Option 2 seems to be more readable and flexible from what I can see. Is this the recommended Ruby best practice for implementing Ruby methods that have more than a couple of parameters which have to be passed? Regards Greg ------=_Part_7124_26003725.1176383156505--