Class: NewStoreApi::VertexTargetFieldEnum
- Inherits:
-
Object
- Object
- NewStoreApi::VertexTargetFieldEnum
- Defined in:
- lib/new_store_api/models/vertex_target_field_enum.rb
Overview
Vertex flexible field type.
Constant Summary collapse
- VERTEX_TARGET_FIELD_ENUM =
[ # TODO: Write general description for FLEXIBLE_CODE_FIELD FLEXIBLE_CODE_FIELD = 'flexible_code_field'.freeze, # TODO: Write general description for FLEXIBLE_NUMERIC_FIELD FLEXIBLE_NUMERIC_FIELD = 'flexible_numeric_field'.freeze, # TODO: Write general description for FLEXIBLE_DATE_FIELD FLEXIBLE_DATE_FIELD = 'flexible_date_field'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = FLEXIBLE_CODE_FIELD) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/new_store_api/models/vertex_target_field_enum.rb', line 26 def self.from_value(value, default_value = FLEXIBLE_CODE_FIELD) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'flexible_code_field' then FLEXIBLE_CODE_FIELD when 'flexible_numeric_field' then FLEXIBLE_NUMERIC_FIELD when 'flexible_date_field' then FLEXIBLE_DATE_FIELD else default_value end end |
.validate(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/new_store_api/models/vertex_target_field_enum.rb', line 20 def self.validate(value) return false if value.nil? VERTEX_TARGET_FIELD_ENUM.include?(value) end |