[Rails] Re: question about passing an array iterator instance to a block

2012-02-25 Thread John Merlino
You know what your completely right. The block only will take what the yield method returns to it. So apparently when instantiating an array with that first argument setting a size limit for array, the constructor contains a yield method which yields each iteration of that size limit. And then the

[Rails] Re: question about passing an array iterator instance to a block

2012-02-25 Thread John Merlino
thanks for response but that was just an example and not really what my question was about. Perhaps this is a better example: >> Array.new(10) do |id| ?> "'#{(id + 1).to_s.rjust(2,"0")}'" >> end => ["'01'", "'02'", "'03'", "'04'", "'05'", "'06'", "'07'", "'08'", "'09'", "'10'"] Why is "id" not