class Spark::Command::Take


Take

Public Instance Methods

run(iterator, index) click to toggle source
# File lib/spark/command/basic.rb, line 281
def run(iterator, index)
  if index == @last_part && iterator.size > @total
    return iterator.slice!(0, @total)
  end

  iterator
end