Class: MistApi::FingerprintsCountDistinctEnum
- Inherits:
-
Object
- Object
- MistApi::FingerprintsCountDistinctEnum
- Defined in:
- lib/mist_api/models/fingerprints_count_distinct_enum.rb
Overview
enum: ‘family`, `model`, `os`, `os_type`
Constant Summary collapse
- FINGERPRINTS_COUNT_DISTINCT_ENUM =
[ # TODO: Write general description for FAMILY FAMILY = 'family'.freeze, # TODO: Write general description for MODEL MODEL = 'model'.freeze, # TODO: Write general description for OS OS = 'os'.freeze, # TODO: Write general description for OS_TYPE OS_TYPE = 'os_type'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = FAMILY) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/fingerprints_count_distinct_enum.rb', line 29 def self.from_value(value, default_value = FAMILY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'family' then FAMILY when 'model' then MODEL when 'os' then OS when 'os_type' then OS_TYPE else default_value end end |
.validate(value) ⇒ Object
23 24 25 26 27 |
# File 'lib/mist_api/models/fingerprints_count_distinct_enum.rb', line 23 def self.validate(value) return false if value.nil? FINGERPRINTS_COUNT_DISTINCT_ENUM.include?(value) end |