Class: MistApi::ApZigbeeAllowJoinEnum

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

Overview

Controls whether new Zigbee devices are allowed to join the network. enum: ‘always`, `manual`

Constant Summary collapse

AP_ZIGBEE_ALLOW_JOIN_ENUM =
[
  # TODO: Write general description for ALWAYS
  ALWAYS = 'always'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ALWAYS) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mist_api/models/ap_zigbee_allow_join_enum.rb', line 24

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

  str = value.to_s.strip

  case str.downcase
  when 'always' then ALWAYS
  when 'manual' then MANUAL
  else
    default_value
  end
end

.validate(value) ⇒ Object



18
19
20
21
22
# File 'lib/mist_api/models/ap_zigbee_allow_join_enum.rb', line 18

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

  AP_ZIGBEE_ALLOW_JOIN_ENUM.include?(value)
end