Class: Wukong::Processor::FromTsv
- Inherits:
-
Serializer
- Object
- Hanuman::Stage
- Wukong::Processor
- Serializer
- Wukong::Processor::FromTsv
- Defined in:
- lib/wukong/widget/serializers.rb
Overview
A widget for deserializing inputs from TSV.
Constant Summary
Constants inherited from Wukong::Processor
Instance Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
Instance Method Summary collapse
-
#process(record) {|obj| ... } ⇒ Object
Yields the input
record
deserialized from TSV.
Methods inherited from Serializer
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(record) {|obj| ... } ⇒ Object
Yields the input record
deserialized from TSV.
137 138 139 140 141 142 143 144 145 146 |
# File 'lib/wukong/widget/serializers.rb', line 137 def process(record) if record.respond_to?(:from_tsv) obj = record.from_tsv else obj = record.split(/\t/) end yield obj rescue => e handle_error(record, e) end |