Prev: difference between $0 and __FILE__
Next: Immediate need for Business Analyst with Cognos exp in MO
From: Jakub on 17 May 2010 05:05 Hi there! (following up the discussion from last year) This method actually made my life a lot easier when fitting some data to a table. I had tens of pictures and wanted to show them in rows - three columns each. data.each_cons(3) do |column| column.each do |picture| show picture end end I was playing with indices, modulos and stuff. After refactoring with each_cons, the code looked much cleaner. cheers!
|
Pages: 1 Prev: difference between $0 and __FILE__ Next: Immediate need for Business Analyst with Cognos exp in MO |