method

take

v1_9_3_125 - Show latest stable - Class: Enumerable
take(p1)
public

Returns first n elements from enum.

a = [1, 2, 3, 4, 5, 0]
a.take(3)             #=> [1, 2, 3]