Skip to content

Commit

Permalink
Fix Arrar#fetch_values' documentation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrocha committed Dec 13, 2024
1 parent 89d0a60 commit 34fd078
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ def last n = unspecified = true
# at the offsets specified by +indexes+. Each of the +indexes+ must be an
# {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 # => []
# a = [:foo, :bar, :baz]
# 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.
#
Expand Down

0 comments on commit 34fd078

Please sign in to comment.