Class: Wukong::Processor::Extract
- Inherits:
-
Wukong::Processor
- Object
- Hanuman::Stage
- Wukong::Processor
- Wukong::Processor::Extract
- Includes:
- DynamicGet
- Defined in:
- lib/wukong/widget/extract.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 Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
Instance Method Summary collapse
-
#process(record) {|part| ... } ⇒ Object
Extract a
part
of arecord
.
Methods included from DynamicGet
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_stage_link, #linkable_name, #root
Instance Method Details
#process(record) {|part| ... } ⇒ Object
Extract a part
of a record
.
116 117 118 |
# File 'lib/wukong/widget/extract.rb', line 116 def process record yield get(self.part, record) end |