Class: MistApi::AutoPlacementInfoStatusEnum

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

Overview

the status of autoplacement for a given map. enum: ‘done`, `error`, `inprogress`, `pending`

Constant Summary collapse

AUTO_PLACEMENT_INFO_STATUS_ENUM =
[
  # TODO: Write general description for DONE
  DONE = 'done'.freeze,

  # TODO: Write general description for ERROR
  ERROR = 'error'.freeze,

  # TODO: Write general description for INPROGRESS
  INPROGRESS = 'inprogress'.freeze,

  # TODO: Write general description for PENDING
  PENDING = 'pending'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = DONE) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/mist_api/models/auto_placement_info_status_enum.rb', line 30

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

  str = value.to_s.strip

  case str.downcase
  when 'done' then DONE
  when 'error' then ERROR
  when 'inprogress' then INPROGRESS
  when 'pending' then PENDING
  else
    default_value
  end
end

.validate(value) ⇒ Object



24
25
26
27
28
# File 'lib/mist_api/models/auto_placement_info_status_enum.rb', line 24

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

  AUTO_PLACEMENT_INFO_STATUS_ENUM.include?(value)
end