Method: Calc::Q#upto
- Defined in:
- lib/calc/q.rb
#upto(limit, &block) ⇒ Enumerator?
Iterates the given block, yielding values from self increasing by 1 up to and including limit
x.upto(limit) is equivalent to x.step(by: 1, to: limit)
If no block is given, an Enumerator is returned instead.
634 635 636 |
# File 'lib/calc/q.rb', line 634 def upto(limit, &block) step(limit, ONE, &block) end |