Class: MistApi::SwitchIotPortInputSrcEnum

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

Overview

Only for “OUT” ports, input source for the switch iot port out. enum: ‘IN0`, `IN1`

Constant Summary collapse

SWITCH_IOT_PORT_INPUT_SRC_ENUM =
[
  # TODO: Write general description for IN0
  IN0 = 'IN0'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = IN0) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'in0' then IN0
  when 'in1' then IN1
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  SWITCH_IOT_PORT_INPUT_SRC_ENUM.include?(value)
end