Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Range#begin

self.begin → object

Returns the object that defines the beginning of self.

Example
(1..4).begin # => 1
(..2).begin  # => nil

Related: Range#first, Range#end.

See also #as_json #bsearch #=== #count also in 4.0 · 3.4 · 3.2 · 3.1 · 3.0