Module: Corefines::Array::Third

Defined in:
lib/corefines/array.rb

Instance Method Summary collapse

Instance Method Details

#thirdvoid

Returns the third element, or nil if doesn't exist.

Returns:

  • the third element, or nil if doesn't exist.


20
21
22
23
24
25
26
# File 'lib/corefines/array.rb', line 20

module Third
  refine ::Array do
    def third
      self[2]
    end
  end
end