upTo

.upTo( max ) { |i| ... }

For iterating from this number, up to the max value given. upTo will yield on each iteration. If max is smaller then this value, then no iteration is performed. By default it will increment in a step of 1.

// prints out the values from 10 to 19, on the console
10.upTo( 20 ) do |i|
    console( i )
end

.upTo( max, step ) { |i| ... }

This version of upTo takes a 'step' value, which states how much to increment on each iteration.

// prints out the values from 10 to 19.5, on the console
// but increments in 0.5
10.upTo( 20, 0.5 ) do |i|
    console( i )
end