Method: Functional::Tuple#at
- Defined in:
- lib/functional/tuple.rb
#at(index) ⇒ Object Also known as: nth, []
Retrieve the item at the given index. Indices begin at zero and increment up, just like Ruby arrays. Negative indicies begin at -1, which represents the last item in the tuple, and decrement toward the first item. If the given index is out of range then ‘nil` is returned.
53 54 55 |
# File 'lib/functional/tuple.rb', line 53 def at(index) @data[index] end |