Class: MistApi::BgpStatsStateEnum
- Inherits:
-
Object
- Object
- MistApi::BgpStatsStateEnum
- Defined in:
- lib/mist_api/models/bgp_stats_state_enum.rb
Overview
enum: ‘active`, `connect`, `established`, `idle`, `open_config`, `open_sent`
Constant Summary collapse
- BGP_STATS_STATE_ENUM =
[ # TODO: Write general description for ACTIVE ACTIVE = 'active'.freeze, # TODO: Write general description for CONNECT CONNECT = 'connect'.freeze, # TODO: Write general description for ESTABLISHED ESTABLISHED = 'established'.freeze, # TODO: Write general description for IDLE IDLE = 'idle'.freeze, # TODO: Write general description for OPEN_CONFIG OPEN_CONFIG = 'open_config'.freeze, # TODO: Write general description for OPEN_SENT OPEN_SENT = 'open_sent'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ACTIVE) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/mist_api/models/bgp_stats_state_enum.rb', line 35 def self.from_value(value, default_value = ACTIVE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'active' then ACTIVE when 'connect' then CONNECT when 'established' then ESTABLISHED when 'idle' then IDLE when 'open_config' then OPEN_CONFIG when 'open_sent' then OPEN_SENT else default_value end end |
.validate(value) ⇒ Object
29 30 31 32 33 |
# File 'lib/mist_api/models/bgp_stats_state_enum.rb', line 29 def self.validate(value) return false if value.nil? BGP_STATS_STATE_ENUM.include?(value) end |