Class: MistApi::UseAutoApValuesForEnum
- Inherits:
-
Object
- Object
- MistApi::UseAutoApValuesForEnum
- Defined in:
- lib/mist_api/models/use_auto_ap_values_for_enum.rb
Overview
The selector to choose auto placement or auto orientation. enum: ‘orientation`, `placement`
Constant Summary collapse
- USE_AUTO_AP_VALUES_FOR_ENUM =
[ # TODO: Write general description for ORIENTATION ORIENTATION = 'orientation'.freeze, # TODO: Write general description for PLACEMENT PLACEMENT = 'placement'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ORIENTATION) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mist_api/models/use_auto_ap_values_for_enum.rb', line 24 def self.from_value(value, default_value = ORIENTATION) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'orientation' then ORIENTATION when 'placement' then PLACEMENT else default_value end end |
.validate(value) ⇒ Object
18 19 20 21 22 |
# File 'lib/mist_api/models/use_auto_ap_values_for_enum.rb', line 18 def self.validate(value) return false if value.nil? USE_AUTO_AP_VALUES_FOR_ENUM.include?(value) end |