We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Array#fetch_values
1 parent 562b9fc commit a5f3a01Copy full SHA for a5f3a01
array.rb
@@ -187,13 +187,13 @@ def last n = unspecified = true
187
# {integer-convertible object}[rdoc-ref:implicit_conversion.rdoc@Integer-Convertible+Objects]:
188
#
189
# a = [:foo, :bar, :baz]
190
- # a.fetch_values(3, 1) # => [:baz, :foo]
191
- # a.fetch_values(3.1, 1) # => [:baz, :foo]
+ # a.fetch_values(2, 0) # => [:baz, :foo]
+ # a.fetch_values(2.1, 0) # => [:baz, :foo]
192
# a.fetch_values # => []
193
194
# For a negative index, counts backwards from the end of the array:
195
196
- # a.fetch_values([-2, -1]) # [:bar, :baz]
+ # a.fetch_values(-2, -1) # [:bar, :baz]
197
198
# When no block is given, raises an exception if any index is out of range.
199
0 commit comments