prev - up - next - index

Range

The Range class describes the interval. The range object is created by the range operator (.. or ...). For example:

for i in 1..5
  ...
end

This means to create an interval from 1 to 5 by .. operator, and iterate over each value within the interval.

The operands for the range operator must respond to the upto method.

Note That an interval contains both ends.

SuperClass:

Object

Included Modules:

Enumerable

Class Methods:

new(first,last)

Creates the range object from first to last.

Methods:

self === other

Returns true if other is within the range. This operator is mostly used by the case statement.

each {|item| ...}

Iterates over each item within the range.

first

Returns the start point of the range.

last

Returns the end point of the range.


prev - up - next - index

matz@caelum.co.jp