Class: Integer
Instance Method Summary collapse
-
#up_or_downto(limit) ⇒ Object
Iterates the given block, passing in increasing or decreasing values to and including limit.
Instance Method Details
#up_or_downto(limit) ⇒ Object
Iterates the given block, passing in increasing or decreasing values to and including limit
If no block is given, an Enumerator is returned instead.
13 14 15 |
# File 'lib/core_ext/integer.rb', line 13 def up_or_downto(limit) self > limit ? self.downto(limit) : self.upto(limit) end |