Class: Necromancer::ArrayConverters::ArrayToSetConverter
- Defined in:
- lib/necromancer/converters/array.rb
Overview
An object that converts an array to a set
Instance Attribute Summary
Attributes inherited from Converter
#config, #convert, #source, #target
Instance Method Summary collapse
-
#call(value, strict: config.strict) ⇒ Object
Convert an array to a set.
Methods inherited from Converter
create, #initialize, #raise_conversion_type
Constructor Details
This class inherits a constructor from Necromancer::Converter
Instance Method Details
#call(value, strict: config.strict) ⇒ Object
Convert an array to a set
177 178 179 180 181 |
# File 'lib/necromancer/converters/array.rb', line 177 def call(value, strict: config.strict) value.to_set rescue StandardError strict ? raise_conversion_type(value) : value end |