Class: MistApi::DhcpdConfigVendorOptionTypeEnum

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

Overview

enum: ‘boolean`, `hex`, `int16`, `int32`, `ip`, `string`, `uint16`, `uint32`

Constant Summary collapse

DHCPD_CONFIG_VENDOR_OPTION_TYPE_ENUM =
[
  # TODO: Write general description for BOOLEAN
  BOOLEAN = 'boolean'.freeze,

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

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BOOLEAN) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/dhcpd_config_vendor_option_type_enum.rb', line 41

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

  str = value.to_s.strip

  case str.downcase
  when 'boolean' then BOOLEAN
  when 'hex' then HEX
  when 'int16' then INT16
  when 'int32' then INT32
  when 'ip' then IP
  when 'string' then STRING
  when 'uint16' then UINT16
  when 'uint32' then UINT32
  else
    default_value
  end
end

.validate(value) ⇒ Object



35
36
37
38
39
# File 'lib/mist_api/models/dhcpd_config_vendor_option_type_enum.rb', line 35

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

  DHCPD_CONFIG_VENDOR_OPTION_TYPE_ENUM.include?(value)
end