Class: Scheming::Type::Enum

Inherits:
Base
  • Object
show all
Defined in:
lib/scheming/type.rb

Overview

Enumeration Type Definition

The wrapper that describes a type and holds a discrete set of values of that type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, values:) ⇒ Enum

Returns a new instance of Enum.

Parameters:



64
65
66
67
68
69
# File 'lib/scheming/type.rb', line 64

def initialize(type, values:)
  super()
  @type = type
  @values = values
  freeze
end

Instance Attribute Details

#typeScheming::Type::Base (readonly)



57
58
59
# File 'lib/scheming/type.rb', line 57

def type
  @type
end

#valuesSet<Object> (readonly)

Returns:



60
61
62
# File 'lib/scheming/type.rb', line 60

def values
  @values
end