Class: MistApi::AvprofileProtocolEnum

Inherits:
Object
  • Object
show all
Defined in:
lib/mist_api/models/avprofile_protocol_enum.rb

Overview

avprofile_protocol.

Constant Summary collapse

AVPROFILE_PROTOCOL_ENUM =
[
  # TODO: Write general description for FTP
  FTP = 'ftp'.freeze,

  # TODO: Write general description for HTTP
  HTTP = 'http'.freeze,

  # TODO: Write general description for IMAP
  IMAP = 'imap'.freeze,

  # TODO: Write general description for POP3
  POP3 = 'pop3'.freeze,

  # TODO: Write general description for SMTP
  SMTP = 'smtp'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = FTP) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/avprofile_protocol_enum.rb', line 32

def self.from_value(value, default_value = FTP)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'ftp' then FTP
  when 'http' then HTTP
  when 'imap' then IMAP
  when 'pop3' then POP3
  when 'smtp' then SMTP
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/mist_api/models/avprofile_protocol_enum.rb', line 26

def self.validate(value)
  return false if value.nil?

  AVPROFILE_PROTOCOL_ENUM.include?(value)
end