Class: Spark::Command::Compact

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

Overview


Compact

Instance Method Summary collapse

Instance Method Details

#lazy_run(iterator) ⇒ Object



96
97
98
99
100
# File 'lib/spark/command/basic.rb', line 96

def lazy_run(iterator, *)
  iterator.select do |item|
    !item.nil?
  end
end

#run(iterator) ⇒ Object



91
92
93
94
# File 'lib/spark/command/basic.rb', line 91

def run(iterator, *)
  iterator.compact!
  iterator
end