From: Intransition Date: 2013-01-27T03:46:34+09:00 Subject: Re: Combine 3 hash into one ------=_Part_399_15409135.1359225991678 Content-Type: multipart/alternative; boundary="----=_Part_400_8229303.1359225991678" ------=_Part_400_8229303.1359225991678 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Saturday, January 26, 2013 1:04:55 PM UTC-5, robert lengu wrote: > > Hi > I am trying to marge 3 hash : hash1["errors"] ,hash2["errors"],hash3 > > so what i am doing this > > p hash1["errors"].zip(hash2["errors"],hash3).flatten.compact > > Which works fine when hash1["errors"] has at least one value > > > but problem is : > > if hash1["errors"] (which is the first one in marge) > does not have any Value, then whole marge hash values show nill > > output . > > [] > > Zipping and merging are not the same. Try #merge method. ------=_Part_400_8229303.1359225991678 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On Saturday, January 26, 2013 1:04:55 PM UTC-5, robert lengu wrote:
Hi
I am trying to marge 3 hash  :  hash1["errors"] ,hash2["errors"],hash3

so what i am doing this

 p  hash1["errors"].zip(hash2["errors"],hash3).flatten.compact

Which works fine when hash1["errors"] has at least one value


but problem is :

if hash1["errors"] (which is the first one in marge)
does not have any Value, then whole marge hash values show nill

output .

[]


Zipping and merging are not the same. Try #merge method. 
------=_Part_400_8229303.1359225991678-- ------=_Part_399_15409135.1359225991678--