class Necromancer::ArrayConverters::ArrayToBooleanArrayConverter

An object that converts an array to an array with boolean values

Public Instance Methods

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

@example

converter.call(["t", "f", "yes", "no"]) # => [true, false, true, false]

@param [Array] value

the array value to boolean

@api public

# File lib/necromancer/converters/array.rb, line 144
def call(value, strict: config.strict)
  bool_converter = BooleanConverters::StringToBooleanConverter.new(:string,
                                                                   :boolean)
  value.map { |val| bool_converter.(val, strict: strict) }
end