to(position)
Returns the beginning of the array up to position.
%w( a b c d ).to(0) # => %w( a ) %w( a b c d ).to(2) # => %w( a b c ) %w( a b c d ).to(10) # => %w( a b c d )
# File activesupport/lib/active_support/core_ext/array/access.rb, line 20 def to(position) self[0..position] end