From: Scott Date: 2006-02-05T03:38:19+09:00 Subject: Re: Extract hash into local variables? This is a weak solution, but: args.each_pair { |k, v| instance_variable_set("@#{k}", v) } will create instance variables for each key in the hash and set them to the associated value. There may be a way to extend Hash with an extract method, but I'm not thinking right now so :) Calling instance_variable_set will create the variable within the scope of the Hash, so it wont be usable where you actually want it. Another solution could be to use OpenStruct: def foo(args={:a=>1, :b=>2, :c=>3}) args = OpenStruct.new(args) puts args.a puts args.b puts args.c end Hope that helps a little, Scott