From: Robert Klemme Date: 2010-10-07T21:17:52+09:00 Subject: Re: Can anyone give a an example of this please On Thu, Oct 7, 2010 at 2:14 PM, Phillip Gawlowski wrote: > On Thu, Oct 7, 2010 at 2:01 PM, Kaye Ng wrote: >> "code blocks may accept none, one, or more parameters" >> >> I understand how ONE parameter is passed using the 'each' method. >> I also understand how TWO parameters is passed, like in this code >> x = { "a" => 100, "b" => 20 } >> x.delete_if { |key, value| value < 25 } >> p x >> >> Can anyone give me a very simple and executable code where: >> NO parameters is passed, and > > irb(main):001:0> [0,1,2,3].each { puts "no param" } > no param > no param > no param > no param > => [0, 1, 2, 3] There is _one_ parameter passed - you just do not pick it up in the block. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/