Class: MistApi::RemoteSyslogTimeFormatEnum
- Inherits:
-
Object
- Object
- MistApi::RemoteSyslogTimeFormatEnum
- Defined in:
- lib/mist_api/models/remote_syslog_time_format_enum.rb
Overview
enum: ‘millisecond`, `year`, `year millisecond`
Constant Summary collapse
- REMOTE_SYSLOG_TIME_FORMAT_ENUM =
[ # TODO: Write general description for MILLISECOND MILLISECOND = 'millisecond'.freeze, # TODO: Write general description for YEAR YEAR = 'year'.freeze, # TODO: Write general description for ENUM_YEAR_MILLISECOND ENUM_YEAR_MILLISECOND = 'year millisecond'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = MILLISECOND) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mist_api/models/remote_syslog_time_format_enum.rb', line 26 def self.from_value(value, default_value = MILLISECOND) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'millisecond' then MILLISECOND when 'year' then YEAR when 'enum_year_millisecond' then ENUM_YEAR_MILLISECOND else default_value end end |
.validate(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/mist_api/models/remote_syslog_time_format_enum.rb', line 20 def self.validate(value) return false if value.nil? REMOTE_SYSLOG_TIME_FORMAT_ENUM.include?(value) end |