Skip to content

Commit a5f3a01

Browse files
authored
[DOC] Fix incorrect Array#fetch_values examples (#12337)
[DOC] Fix incorrect Array#fetch_values examples
1 parent 562b9fc commit a5f3a01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

array.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ def last n = unspecified = true
187187
# {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects]:
188188
#
189189
# a = [:foo, :bar, :baz]
190-
# a.fetch_values(3, 1) # => [:baz, :foo]
191-
# a.fetch_values(3.1, 1) # => [:baz, :foo]
190+
# a.fetch_values(2, 0) # => [:baz, :foo]
191+
# a.fetch_values(2.1, 0) # => [:baz, :foo]
192192
# a.fetch_values # => []
193193
#
194194
# For a negative index, counts backwards from the end of the array:
195195
#
196-
# a.fetch_values([-2, -1]) # [:bar, :baz]
196+
# a.fetch_values(-2, -1) # [:bar, :baz]
197197
#
198198
# When no block is given, raises an exception if any index is out of range.
199199
#

0 commit comments

Comments
 (0)