Class: Necromancer::ArrayConverters::ArrayToBooleanConverter
- Defined in:
- lib/necromancer/converters/array.rb
Overview
An object that converts an array to an array with boolean values
Instance Attribute Summary
Attributes inherited from Converter
Instance Method Summary collapse
Methods inherited from Converter
create, #fail_conversion_type, #initialize
Constructor Details
This class inherits a constructor from Necromancer::Converter
Instance Method Details
#call(value, options = {}) ⇒ Object
62 63 64 65 66 67 |
# File 'lib/necromancer/converters/array.rb', line 62 def call(value, = {}) boolean_converter = BooleanConverters::StringToBooleanConverter.new(:string, :boolean) value.reduce([]) do |acc, el| acc << boolean_converter.call(el, ) end end |