Class: Spark::Command::Shuffle

Inherits:
Object
  • Object
show all
Defined in:
lib/spark/command/basic.rb

Overview


Shuffle

Instance Method Summary collapse

Instance Method Details

#rngObject



127
128
129
# File 'lib/spark/command/basic.rb', line 127

def rng
  Random.new(@seed)
end

#run(iterator) ⇒ Object



122
123
124
125
# File 'lib/spark/command/basic.rb', line 122

def run(iterator, *)
  iterator.shuffle!(random: rng)
  iterator
end