Class: TypedData::Schema::EnumType
- Inherits:
-
Type
- Object
- Type
- TypedData::Schema::EnumType
show all
- Defined in:
- lib/typed_data/schema/enum_type.rb
Constant Summary
Constants inherited
from Type
Type::SUPPORTED_LOGICAL_TYPES
Instance Method Summary
collapse
Methods inherited from Type
#accept, #to_s
Constructor Details
#initialize(name, symbols) ⇒ EnumType
Returns a new instance of EnumType.
6
7
8
9
|
# File 'lib/typed_data/schema/enum_type.rb', line 6
def initialize(name, symbols)
@name = name
@symbols = symbols
end
|
Instance Method Details
#match?(value) ⇒ Boolean
15
16
17
|
# File 'lib/typed_data/schema/enum_type.rb', line 15
def match?(value)
@symbols.include?(value)
end
|
#primitive? ⇒ Boolean
11
12
13
|
# File 'lib/typed_data/schema/enum_type.rb', line 11
def primitive?
false
end
|