class Necromancer::HashConverters::StringToIntegerHashConverter

Public Instance Methods

call(value, strict: config.strict) click to toggle source

Convert string value to hash with integer values

@example

converter.call("a:1 b:2 c:3")
# => {a: 1, b: 2, c: 3}

@api public

# File lib/necromancer/converters/hash.rb, line 47
def call(value, strict: config.strict)
  int_converter = NumericConverters::StringToIntegerConverter.new(:string,
                                                                  :integer)
  hash_converter = StringToHashConverter.new(:string, :hash)
  hash_converter.(value, strict: strict, value_converter: int_converter)
end