class Dry::Types::Enum

def initialize(type, options)

Options Hash: (**options)
  • :values (Array) --

Parameters:
  • options (Hash) --
  • type (Definition) --
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