Skip to content
instance method

Range#entries

() -> ::Array[Elem]
entries

Alias of #to_a

Returns an array containing the elements in self, if a finite collection; raises an exception otherwise.

Example
(1..4).to_a     # => [1, 2, 3, 4]
(1...4).to_a    # => [1, 2, 3]
('a'..'d').to_a # => ["a", "b", "c", "d"]
See also #to_a #end #eql? #each also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0