From: hemant Date: 2007-03-06T00:37:49+09:00 Subject: Re: Nested blocks On 3/5/07, Josselin wrote: > I am trying to nest 2 blocks, it's wrong but but I cannot find why .. > need some help.. I get only one resulting item > > I get info in geocodes Array (3 items) , need to get some of them into > 'places' another Array > > places = [ {:search => adresse}] > > geocodes.each { | geocode | > places.collect { | place | > place[:address] = geocode[:address] > place[:latitude] = geocode[:latitude] > place[:longitude] = geocode[:longitude] > } > } > > geocodes.nitems => 3 #collect doesn't modify the existing Enumerable and normally returns a Enumerable/Array. In other words, your inner block doesn't modify places array at all. -- gnufied ----------- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary. http://people.inxsasia.com/~hemant