Class: Necromancer::HashConverters::StringToFloatHashConverter
- Inherits:
-
Converter
- Object
- Converter
- Necromancer::HashConverters::StringToFloatHashConverter
- Defined in:
- lib/necromancer/converters/hash.rb
Instance Attribute Summary
Attributes inherited from Converter
#config, #convert, #source, #target
Instance Method Summary collapse
-
#call(value, strict: config.strict) ⇒ Object
Convert string value to hash with float values.
Methods inherited from Converter
create, #initialize, #raise_conversion_type
Constructor Details
This class inherits a constructor from Necromancer::Converter
Instance Method Details
#call(value, strict: config.strict) ⇒ Object
Convert string value to hash with float values
63 64 65 66 67 68 |
# File 'lib/necromancer/converters/hash.rb', line 63 def call(value, strict: config.strict) float_converter = NumericConverters::StringToFloatConverter.new(:string, :float) hash_converter = StringToHashConverter.new(:string, :hash) hash_converter.(value, strict: strict, value_converter: float_converter) end |