Class: Necromancer::ArrayConverters::ArrayToNumericConverter
- Defined in:
- lib/necromancer/converters/array.rb
Overview
An object that converts an array to an array with numeric values
Instance Attribute Summary
Attributes inherited from Converter
Instance Method Summary collapse
-
#call(value, options = {}) ⇒ Object
Convert an array to an array of numeric values.
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
Convert an array to an array of numeric values
45 46 47 48 49 50 |
# File 'lib/necromancer/converters/array.rb', line 45 def call(value, = {}) numeric_converter = NumericConverters::StringToNumericConverter.new(:string, :numeric) value.reduce([]) do |acc, el| acc << numeric_converter.call(el, ) end end |