Class: Verizon::ProvisioningStatusFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/verizon/models/provisioning_status_filter.rb

Overview

The last status of the device as a list filter.

Constant Summary collapse

PROVISIONING_STATUS_FILTER =
[
  # TODO: Write general description for UNKNOWN
  UNKNOWN = 'UNKNOWN'.freeze,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = UNKNOWN) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/verizon/models/provisioning_status_filter.rb', line 62

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

  str = value.to_s.strip

  case str.downcase
  when 'unknown' then UNKNOWN
  when 'deactivated' then DEACTIVATED
  when 'activated' then ACTIVATED
  when 'deactive' then DEACTIVE
  when 'active' then ACTIVE
  when 'suspend' then SUSPEND
  when 'pending_activation' then PENDING_ACTIVATION
  when 'pending_deactivation' then PENDING_DEACTIVATION
  when 'pre_active' then PRE_ACTIVE
  when 'activation_ready' then ACTIVATION_READY
  when 'inventory' then INVENTORY
  when 'purged' then PURGED
  when 'replaced' then REPLACED
  when 'retired' then RETIRED
  when 'test_ready' then TEST_READY
  else
    default_value
  end
end

.validate(value) ⇒ Object



56
57
58
59
60
# File 'lib/verizon/models/provisioning_status_filter.rb', line 56

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

  PROVISIONING_STATUS_FILTER.include?(value)
end