From: Erwin Date: 2008-09-08T17:34:01+09:00 Subject: Re: any way to write it in one line ? On 7 sep, 16:50, Jean-Michel wrote: > 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 thanks a lot ...