Module: Corefines::Array::Second

Defined in:
lib/corefines/array.rb

Instance Method Summary collapse

Instance Method Details

#secondvoid

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

Returns:

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


9
10
11
12
13
14
15
# File 'lib/corefines/array.rb', line 9

module Second
  refine ::Array do
    def second
      self[1]
    end
  end
end