Class: Wukong::Processor::Map
- Inherits:
-
Wukong::Processor
- Object
- Hanuman::Stage
- Wukong::Processor
- Wukong::Processor::Map
- Defined in:
- lib/wukong/widget/operators.rb
Overview
Yield the result of this processor's action for each input record.
Can also be called with the :compact option which will check if the result of the action is non falsy before yielding.
Constant Summary
Constants inherited from Wukong::Processor
Instance Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
Instance Method Summary collapse
-
#process(input_record) {|output_record| ... } ⇒ Object
Call #perform_action on the input_record and yield the returned output record.
Methods inherited from Wukong::Processor
configure, description, #finalize, #perform_action, #receive_action, #setup, #stop
Methods included from Logging
Methods inherited from Hanuman::Stage
Methods included from Hanuman::StageClassMethods
#builder, #label, #register, #set_builder
Methods included from Hanuman::StageInstanceMethods
#add_link, #linkable_name, #root
Instance Method Details
#process(input_record) {|output_record| ... } ⇒ Object
Call #perform_action on the input_record and yield the returned output record.
If #compact then only yield the output record if it is not falsy.
42 43 44 45 46 47 48 49 |
# File 'lib/wukong/widget/operators.rb', line 42 def process(input_record) output_record = perform_action(input_record) if compact yield output_record if output_record else yield output_record end end |