From: Li Chen Date: 2009-06-24T00:36:04+09:00 Subject: Is it the ruby way to implement #downto Hi all, I wonder if the following code is the ruby way to implement Integer#downto. Thanks, Li ####################### class Integer def my_downto(final=2) for i in (final..self).to_a.reverse yield i end end end 10.my_downto(-1) do |i| puts i end -- Posted via http://www.ruby-forum.com/.