From: Josselin Date: 2007-01-21T03:00:09+09:00 Subject: Re: conditional value in hash array ? On 2007-01-20 17:57:01 +0100, Robert Klemme said: > On 20.01.2007 16:38, Josselin wrote: >> my objective is not entering a value in the array if the domain is nil >> so it seems I should enter first nil if domain is nil as you stated >> then compact the array to get rid of nil values.. > > What exactly are you trying to achieve? Is it maybe rather something > like this: > > hash = { > :distance => radius.to_f, > :valid_until => Time.now.utc > } > hash[ :category ]= domain unless domain.nil? > > Regards > > robert thanks that's better... forgot the key nme ..