From: Jean-Michel Date: 2008-09-07T23:49:00+09:00 Subject: Re: any way to write it in one line ? On Sep 6, 11:17 am, Erwin wrote: >      works =  Array.new >      session[:cart_works].each_pair {|key, value| works << key if > value == user_id} > > how to initialize the works array in the bloc ? > > thanks for your lights > > erwin h = Hash[ * %w(apple red lemon yellow bananna yellow orange orange) ] h.clone.delete_if { |k,v| v != 'yellow' }.keys Jean-Michel