Class: Necromancer::ArrayConverters::ObjectToArrayConverter
- Defined in:
- lib/necromancer/converters/array.rb
Overview
An object that converts an object to an array
Instance Attribute Summary
Attributes inherited from Converter
Instance Method Summary collapse
-
#call(value, options = {}) ⇒ Object
Convert an object to an array.
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 object to an array
78 79 80 81 82 83 84 85 |
# File 'lib/necromancer/converters/array.rb', line 78 def call(value, = {}) strict = .fetch(:strict, config.strict) begin Array(value) rescue strict ? fail_conversion_type(value) : value end end |