Class: MistApi::OrgSettingMistNacIpVersionEnum

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

Overview

by default, NAS devices(switches/aps) and proxies(mxedge) are configured to reach mist-nac via IPv4. enum: ‘v4`, `v6`

Constant Summary collapse

ORG_SETTING_MIST_NAC_IP_VERSION_ENUM =
[
  # TODO: Write general description for V4
  V4 = 'v4'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = V4) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'v4' then V4
  when 'v6' then V6
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  ORG_SETTING_MIST_NAC_IP_VERSION_ENUM.include?(value)
end