Class: Wukong::Processor::Extract
- Inherits:
-
Wukong::Processor
- Object
- Hanuman::Stage
- Wukong::Processor
- Wukong::Processor::Extract
- Includes:
- DynamicGet
- Defined in:
- lib/wukong/widget/processors.rb
Overview
A widget that extracts parts of incoming records.
This widget can extract part of the following kinds of objects:
- Hash
- Array
- JSON string
- delimited string ("\t" or "," or other)
- models
In each case it will attempt to appropriately parse its :part argument.
This even works on nested keys using a dot ('.') to separate the keys:
Objects like Hashes, Arrays, and models, which would have to serialize within a command-line flow, can also be extracted from within a dataflow:
Constant Summary
Constants inherited from Wukong::Processor
Instance Method Summary collapse
-
#process(record) {|part| ... } ⇒ Object
Extract a
partof arecord.
Methods included from DynamicGet
Methods inherited from Wukong::Processor
configure, consumes, description, #expected_record_type, #expected_serialization, #finalize, #perform_action, produces, #receive_action, #setup, #stop, valid_serializer?, validate_and_set_serialization
Methods included from Logging
Methods included from Hanuman::StageClassMethods
#builder, #label, #register, #set_builder
Instance Method Details
#process(record) {|part| ... } ⇒ Object
Extract a part of a record.
168 169 170 |
# File 'lib/wukong/widget/processors.rb', line 168 def process record yield get(self.part, record) end |