method

first

v1_9_2_180 - Show latest stable - Class: Enumerable
first(p1 = v1)
public

Returns the first element, or the first n elements, of the enumerable. If the enumerable is empty, the first form returns nil, and the second form returns an empty array.

1Note

Video Explanation of first, last and each

MattStopa ยท Mar 14, 2012