Class: DataMaps::Then::Convert
- Inherits:
-
Base
- Object
- Executable
- Base
- DataMaps::Then::Convert
- Defined in:
- lib/data_maps/then/convert.rb
Overview
A then to convert values
Instance Attribute Summary collapse
- #converter ⇒ Object readonly
Attributes inherited from Executable
Instance Method Summary collapse
- #after_initialize ⇒ Object
-
#execute(data) ⇒ Object
The execute method which returns the converted data.
Methods inherited from Executable
#initialize, valid_collection?
Constructor Details
This class inherits a constructor from DataMaps::Executable
Instance Attribute Details
#converter ⇒ Object (readonly)
7 8 9 |
# File 'lib/data_maps/then/convert.rb', line 7 def converter @converter end |
Instance Method Details
#after_initialize ⇒ Object
9 10 11 |
# File 'lib/data_maps/then/convert.rb', line 9 def after_initialize @converter = DataMaps::Converter.create_from_map(option) end |
#execute(data) ⇒ Object
The execute method which returns the converted data
16 17 18 19 20 |
# File 'lib/data_maps/then/convert.rb', line 16 def execute(data) converter.reduce(data) do |data, c| c.execute(data) end end |