instance method
from
Ruby on Rails 8.0.4
Since v3.0.20Signature
from(position)
Returns the tail of the array from position.
%w( a b c d ).from(0) # => ["a", "b", "c", "d"] %w( a b c d ).from(2) # => ["c", "d"] %w( a b c d ).from(10) # => [] %w().from(0) # => [] %w( a b c d ).from(-2) # => ["c", "d"] %w( a b c ).from(-10) # => []
Parameters
-
positionreq
Source
# File activesupport/lib/active_support/core_ext/array/access.rb, line 12
def from(position)
self[position, length] || []
end
Defined in activesupport/lib/active_support/core_ext/array/access.rb line 12
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Array