class Necromancer::ArrayConverters::ArrayToNumericArrayConverter
An object that converts an array to an array with numeric values
Public Instance Methods
call(value, strict: config.strict)
click to toggle source
Convert an array to an array of numeric values
@example
converter.call(["1", "2.3", "3.0]) # => [1, 2.3, 3.0]
@param [Array] value
the value to convert
@api public
# File lib/necromancer/converters/array.rb, line 128 def call(value, strict: config.strict) num_converter = NumericConverters::StringToNumericConverter.new(:string, :numeric) value.map { |val| num_converter.(val, strict: strict) } end