Method: Immutable::List#drop
- Defined in:
- lib/immutable/list.rb
#drop(number) ⇒ List
Return a List containing all items after the first number items from this List.
357 358 359 360 361 362 363 364 365 366 |
# File 'lib/immutable/list.rb', line 357 def drop(number) LazyList.new do list = self while !list.empty? && number > 0 number -= 1 list = list.tail end list end end |