Class: Parameters::Types::Set
- Defined in:
- lib/parameters/types/set.rb
Instance Attribute Summary
Attributes inherited from Array
Class Method Summary collapse
-
.coerce(value) ⇒ ::Set
Coerces a value into a Set.
Methods inherited from Array
#==, #===, #coerce, element_type, #initialize, #to_ruby
Methods inherited from Object
Methods inherited from Type
#<, #<=, #==, ===, #===, #coerce, #to_ruby, to_ruby
Constructor Details
This class inherits a constructor from Parameters::Types::Array
Class Method Details
.coerce(value) ⇒ ::Set
Coerces a value into a Set.
18 19 20 21 22 23 24 |
# File 'lib/parameters/types/set.rb', line 18 def self.coerce(value) if value.respond_to?(:to_set) value.to_set else ::Set[value] end end |