to

.to( n ) { |i| ... }

Iterates from this number, to the 'n' number given, and will yield for each increment. If n is greater then this, then it steps in increments of 1. If n is smaller, then it will step in increments of -1.

// prints numbers from 10 to 19 on the console
10.to( 20 ) do |i|
    console( i )
end

.to( n, step ) { |i| ... }

This of 'to' allows you to state the value to step on each increment. Step is automatically adjusted to work in the correct direction, to avoid accidental infinite loops.

// prints out every other number from 10 to 19 on the console
10.to( 20, 2 ) do |i|
    console( i )
end