From: tho_mica_l Date: 2008-02-08T07:20:11+09:00 Subject: Re: info on block arguments Okay, I saw I was too slow. So I only add something to the following point: > but what's the next bit about? namely: { |toy| > toy[:shape] }.each do |toy| Let's break it up. If you don't understand what's going, break the code in smaller pieces and step through it. Or test it in irb. The each{} part is a totally different story. a.sort_by {|n| n}.each {|n| p n} actually should be read rather like: a1 = a.sort_by {|n| n} a2 = a1.each {|n| n} The period joins these two methods into a chain so that each() operates directly on the value of sort_by(), which happens to be the sorted array. Or to stick with the Sesame Street'ish analogy: Mrs Each doesn't care about the Cookiemonster. That's Sorty who sees the Cookiemonster. But Mrs. Each is a grown-up, she cannot see Cookiemonster and thinks such things are just childish phantasies.