From: Dave Thomas Date: 2001-09-04T04:35:32+09:00 Subject: [ruby-talk:20806] Re: passing hashes Chris Moore writes: > A thought occured to me. Earlier there was in the GUI/Fox discussions > mention of possible functionality like > > fxwidget (:x=val, :top=val ) #I don't use fox > > so that you don't have to remember the order of widget options... when the > thought occured to me, why not make it so that you can pass a hash to a > method? this kind of achieves the same functionality using built in classes > and possibly greater flexibility. > > any thoughts? Matz is ahead of you :) def fred(first_param, rest) p first_param p rest end fred 123, :name => "mickey", :type => "mouse" #=> 123 {:type=>"mouse", :name=>"mickey"}