given an Arra tags[]

I need to produce a resulting Hash as following ..

{ "$in" => [tags[0]], "$in" =>[tags[1], ...}

in which the key should be always the same and the value being an
Array

I tried this :

         myHash = {}
         tags.each do |tag|
           h = {"$in" => [tag]}
           myHash.merge!(h)
         end

but the merge! is only  changing the value ...  (as the key is always
the same ..)
(there is no += as with Array class  ...)

thanks for your feedback

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to