Class: MistApi::TunnelViaEnum
- Inherits:
-
Object
- Object
- MistApi::TunnelViaEnum
- Defined in:
- lib/mist_api/models/tunnel_via_enum.rb
Overview
If ‘via`==`tunnel`, specifies which tunnel (primary/secondary) this neighbor is associated with. enum: `primary`, `secondary`
Constant Summary collapse
- TUNNEL_VIA_ENUM =
[ # TODO: Write general description for PRIMARY PRIMARY = 'primary'.freeze, # TODO: Write general description for SECONDARY SECONDARY = 'secondary'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = PRIMARY) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mist_api/models/tunnel_via_enum.rb', line 24 def self.from_value(value, default_value = PRIMARY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'primary' then PRIMARY when 'secondary' then SECONDARY else default_value end end |
.validate(value) ⇒ Object
18 19 20 21 22 |
# File 'lib/mist_api/models/tunnel_via_enum.rb', line 18 def self.validate(value) return false if value.nil? TUNNEL_VIA_ENUM.include?(value) end |