Method: Functional::Tuple#rest
- Defined in:
- lib/functional/tuple.rb
#rest ⇒ Functional::Tuple Also known as: tail
Returns a tuple containing all the items in self after the first item. Returns an empty tuple when empty or there is only one item.
220 221 222 223 224 225 226 |
# File 'lib/functional/tuple.rb', line 220 def rest if @data.length <= 1 Tuple.new else Tuple.new(@data.slice(1..@data.length-1)) end end |