Robert Klemme wrote: > csn <cool_screen_name90001 / yahoo.com> wrote: > > Is there a Ruby function similar to PHP's extract/list? What I'd like > > to do is: > > > > def foo(args={a=>1, b=>2, c=>3}) > > args.extract > > > > puts a > > puts b > > puts c > > end > > > > Thanks > > csn > > You cannot do that as local variables have to be declared in the code. > You'll have to do that by hand, i.e., > Robert's correct in the general case, but you can read a hash and have locals that can be accessed through eval: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/159842 But probably, like he said, you want to refactor