hos to have a conditional value  ?  :  :category => domain unless domain.nil?

wrote :

[ :distance => radius.to_f , :category => domain unless domain.nil?, 
:valid_until  => Time.now.utc]

but giving an error....   unexpected kUNLESS_MOD, expecting ']'