From: tamouse mailing lists Date: 2013-02-03T13:30:27+09:00 Subject: Easy way to handle positional and hashed parameters on a method? Ideally, I'd like to be able to offer either of these on an API I'm creating: my_method('a','b','c) or my_method(first: 'a', second: 'b', third: 'c') I know I can construct the method definition as: def my_method(*args) ... end and whatever way they pass things in will get there. But how can I easily merge them into a hash for use in the rest of the method? I want the end result to look like: {:first => 'a', :second => 'b', :third => 'c'} no matter how they enter them. And could you deal with something where a hash is entered as a positional parameter, and trailing hash values as well?? Like: mymethod(({z: 1, x: 2}),'bazinga!', third: 17) to end up with: {:first => {:z => 1, :x => 2}, :second => 'basinga!', :third => 17} ?