class Parameters::Types::Set

Public Class Methods

coerce(value) click to toggle source

Coerces a value into a Set.

@param [#to_set, ::Object] value

The value to coerce.

@return [::Set]

The coerced Set.
# 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