Class: MistApi::Dot11Bandwidth24Enum
- Inherits:
-
Object
- Object
- MistApi::Dot11Bandwidth24Enum
- Defined in:
- lib/mist_api/models/dot11_bandwidth24_enum.rb
Overview
channel width for the 2.4GHz band. enum: ‘0`(disabled, response only), `20`, `40`
Constant Summary collapse
- DOT11_BANDWIDTH24_ENUM =
[ # TODO: Write general description for ENUM_0 ENUM_0 = 0, # TODO: Write general description for ENUM_20 ENUM_20 = 20, # TODO: Write general description for ENUM_40 ENUM_40 = 40 ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_0) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mist_api/models/dot11_bandwidth24_enum.rb', line 27 def self.from_value(value, default_value = ENUM_0) return default_value if value.nil? str = value.to_s.strip if str.match?(/\A\d+\z/) num = str.to_i return num if DOT11_BANDWIDTH24_ENUM.include?(num) return default_value end case str.downcase when 'enum_0' then ENUM_0 when 'enum_20' then ENUM_20 when 'enum_40' then ENUM_40 else default_value end end |
.validate(value) ⇒ Object
21 22 23 24 25 |
# File 'lib/mist_api/models/dot11_bandwidth24_enum.rb', line 21 def self.validate(value) return false if value.nil? DOT11_BANDWIDTH24_ENUM.include?(value) end |