class Dry::Types::Enum
def initialize(type, options)
(**options)
-
:values
(Array
) --
Parameters:
-
options
(Hash
) -- -
type
(Type
) --
def initialize(type, options) super @values = options.fetch(:values).freeze @values.each(&:freeze) @mapping = values.each_with_object({}) { |v, h| h[values.index(v)] = v }.freeze end