class Necromancer::NumericConverters::StringToFloatConverter

An object that converts a String to a Float

Public Instance Methods

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

Convert string to float value

@example

converter.call("1.2") # => 1.2

@api public

# File lib/necromancer/converters/numeric.rb, line 49
def call(value, strict: config.strict)
  Float(value)
rescue StandardError
  strict ? raise_conversion_type(value) : value.to_f
end