Class: Wukong::Processor::ToCsv
- Inherits:
-
Serializer
- Object
- Hanuman::Stage
- Wukong::Processor
- Serializer
- Wukong::Processor::ToCsv
- Defined in:
- lib/wukong/widget/serializers.rb
Overview
A widget for serializing inputs to CSV.
Constant Summary
Constants inherited from Wukong::Processor
Instance Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
Instance Method Summary collapse
-
#process(record) {|csv| ... } ⇒ Object
Yields the input
record
serialized as CSV.
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) {|csv| ... } ⇒ Object
Yields the input record
serialized as CSV.
165 166 167 168 169 170 171 172 173 |
# File 'lib/wukong/widget/serializers.rb', line 165 def process(record) begin csv = record.map(&:to_s).join(",") rescue => e # FIXME -- should we log here or what? return end yield csv end |