Class: MistApi::OrgAssetCountDistinctEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/mist_api/models/org_asset_count_distinct_enum.rb

Overview

enum: ‘ibeacon_major`, `ibeacon_minor`, `ibeacon_uuid`, `mac`, `map_id`, `site_id`

Constant Summary collapse

ORG_ASSET_COUNT_DISTINCT_ENUM =
[
  # TODO: Write general description for IBEACON_MAJOR
  IBEACON_MAJOR = 'ibeacon_major'.freeze,

  # TODO: Write general description for IBEACON_MINOR
  IBEACON_MINOR = 'ibeacon_minor'.freeze,

  # TODO: Write general description for IBEACON_UUID
  IBEACON_UUID = 'ibeacon_uuid'.freeze,

  # TODO: Write general description for MAC
  MAC = 'mac'.freeze,

  # TODO: Write general description for MAP_ID
  MAP_ID = 'map_id'.freeze,

  # TODO: Write general description for SITE_ID
  SITE_ID = 'site_id'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = IBEACON_MAJOR) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/org_asset_count_distinct_enum.rb', line 36

def self.from_value(value, default_value = IBEACON_MAJOR)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'ibeacon_major' then IBEACON_MAJOR
  when 'ibeacon_minor' then IBEACON_MINOR
  when 'ibeacon_uuid' then IBEACON_UUID
  when 'mac' then MAC
  when 'map_id' then MAP_ID
  when 'site_id' then SITE_ID
  else
    default_value
  end
end

.validate(value) ⇒ Object



30
31
32
33
34
# File 'lib/mist_api/models/org_asset_count_distinct_enum.rb', line 30

def self.validate(value)
  return false if value.nil?

  ORG_ASSET_COUNT_DISTINCT_ENUM.include?(value)
end