class Necromancer::ArrayConverters::ObjectToArrayConverter

An object that converts an object to an array

Public Instance Methods

call(value, options = {}) click to toggle source

Convert an object to an array

@example

converter.call({x: 1})   # => [[:x, 1]]

@api public

# File lib/necromancer/converters/array.rb, line 77
def call(value, options = {})
  strict = options.fetch(:strict, config.strict)
  begin
    Array(value)
  rescue
    strict ? fail_conversion_type(value) : value
  end
end