Class: TestKaferiCloud::FieldType
- Inherits:
-
Object
- Object
- TestKaferiCloud::FieldType
- Defined in:
- lib/test_kaferi_cloud/models/field_type.rb
Constant Summary collapse
- TEXT =
0.freeze
- INTEGER =
1.freeze
- BOOLEAN =
2.freeze
- LIST =
3.freeze
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ Fixnum
Builds the enum from string.
Instance Method Details
#build_from_hash(value) ⇒ Fixnum
Builds the enum from string
35 36 37 38 39 40 |
# File 'lib/test_kaferi_cloud/models/field_type.rb', line 35 def build_from_hash(value) constantValues = FieldType.constants.select{ |const_name| FieldType.const_get(const_name) == value} raise "Invalid ENUM value #{value} for class #FieldType" if constantValues.empty? value #constantValues[0] end |