Class: MistApi::RemoteSyslogServerProtocolEnum
- Inherits:
-
Object
- Object
- MistApi::RemoteSyslogServerProtocolEnum
- Defined in:
- lib/mist_api/models/remote_syslog_server_protocol_enum.rb
Overview
enum: ‘tcp`, `udp`
Constant Summary collapse
- REMOTE_SYSLOG_SERVER_PROTOCOL_ENUM =
[ # TODO: Write general description for TCP TCP = 'tcp'.freeze, # TODO: Write general description for UDP UDP = 'udp'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = TCP) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mist_api/models/remote_syslog_server_protocol_enum.rb', line 23 def self.from_value(value, default_value = TCP) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'tcp' then TCP when 'udp' then UDP else default_value end end |
.validate(value) ⇒ Object
17 18 19 20 21 |
# File 'lib/mist_api/models/remote_syslog_server_protocol_enum.rb', line 17 def self.validate(value) return false if value.nil? REMOTE_SYSLOG_SERVER_PROTOCOL_ENUM.include?(value) end |