Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Enumerable#entries

() -> ::Array[E]
entries(*args)

Alias of #to_a

Returns an array containing the items in self:

Example
(0..4).to_a # => [0, 1, 2, 3, 4]
See also #to_a #each_with_object #filter #each_with_index also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0