From: Ryan Davis Date: 2011-02-18T07:32:04+09:00 Subject: Re: question re: small piece of code On Feb 17, 2011, at 14:17 , Gaba Luschi wrote: > Hi, > > In the example book I'm using, I ran across the following lines of code: > > young_people = people.find_all do |p| > p[3].to_i.between?(20,40) > end > > Now, "people" is defined by 'p' is not - what does that code do when it > says "do |p|"? 'p' is a block variable. It is used by find_all as it enumerates people. 'p' contains one element from people at a time.