Method: Wukong::Processor::Map#process

Defined in:
lib/wukong/widget/operators.rb

#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.

Parameters:

  • input_record (Object)

Yields:

  • (output_record)

    if compact, then only yield if it is not falsy

Yield Parameters:

  • output_record (Object)

    the result of #perform_action

See Also:



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