class Necromancer::HashConverters::StringToNumericHashConverter
Public Instance Methods
call(value, strict: config.strict)
click to toggle source
Convert string value to hash with numeric values
@example
converter.call("a:1 b:2.0 c:3") # => {a: 1, b: 2.0, c: 3}
@api public
# File lib/necromancer/converters/hash.rb, line 79 def call(value, strict: config.strict) num_converter = NumericConverters::StringToNumericConverter.new(:string, :numeric) hash_converter = StringToHashConverter.new(:string, :hash) hash_converter.(value, strict: strict, value_converter: num_converter) end