Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Range#end

rng.end → obj

Returns the object that defines the end of the range.

Example
(1..10).end    #=> 10
(1...10).end   #=> 10
See also #each #entries #cover? #eql? also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1