Dec 122010
 
Stop using Ruby's Array.each method

Ruby provides a simple iterator method, each, which allows quick and easy looping over the elements of an array. irb(main):001:0> a = [1, 2, 3, 4, 5] => [1, 2, 3, 4, 5] irb(main):002:0> a.each { |e| puts e } 1 2 3 4 5 However, the each method is one of the more primitive Read more…

© 2010 Geektastical Suffusion theme by Sayontan Sinha