From a5f3a0137564c606c05b4b7a5e7545fbb28a0d9d Mon Sep 17 00:00:00 2001 From: Kouhei Yanagita Date: Sat, 14 Dec 2024 03:25:27 +0900 Subject: [PATCH] [DOC] Fix incorrect `Array#fetch_values` examples (#12337) [DOC] Fix incorrect Array#fetch_values examples --- array.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/array.rb b/array.rb index 638a6b4674..a2270370e8 100644 --- a/array.rb +++ b/array.rb @@ -187,13 +187,13 @@ class Array # {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects]: # # a = [:foo, :bar, :baz] - # a.fetch_values(3, 1) # => [:baz, :foo] - # a.fetch_values(3.1, 1) # => [:baz, :foo] + # a.fetch_values(2, 0) # => [:baz, :foo] + # a.fetch_values(2.1, 0) # => [:baz, :foo] # a.fetch_values # => [] # # For a negative index, counts backwards from the end of the array: # - # a.fetch_values([-2, -1]) # [:bar, :baz] + # a.fetch_values(-2, -1) # [:bar, :baz] # # When no block is given, raises an exception if any index is out of range. #