Class: ElasticEmail::MessageCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/ElasticEmail/models/message_category.rb

Constant Summary collapse

UNKNOWN =
"Unknown".freeze
IGNORE =
"Ignore".freeze
SPAM =
"Spam".freeze
BLACK_LISTED =
"BlackListed".freeze
NO_MAILBOX =
"NoMailbox".freeze
GREY_LISTED =
"GreyListed".freeze
THROTTLED =
"Throttled".freeze
TIMEOUT =
"Timeout".freeze
CONNECTION_PROBLEM =
"ConnectionProblem".freeze
SPF_PROBLEM =
"SPFProblem".freeze
ACCOUNT_PROBLEM =
"AccountProblem".freeze
DNS_PROBLEM =
"DNSProblem".freeze
NOT_DELIVERED_CANCELLED =
"NotDeliveredCancelled".freeze
CODE_ERROR =
"CodeError".freeze
MANUAL_CANCEL =
"ManualCancel".freeze
CONNECTION_TERMINATED =
"ConnectionTerminated".freeze
NOT_DELIVERED =
"NotDelivered".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



36
37
38
# File 'lib/ElasticEmail/models/message_category.rb', line 36

def self.all_vars
  @all_vars ||= [UNKNOWN, IGNORE, SPAM, BLACK_LISTED, NO_MAILBOX, GREY_LISTED, THROTTLED, TIMEOUT, CONNECTION_PROBLEM, SPF_PROBLEM, ACCOUNT_PROBLEM, DNS_PROBLEM, NOT_DELIVERED_CANCELLED, CODE_ERROR, MANUAL_CANCEL, CONNECTION_TERMINATED, NOT_DELIVERED].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



43
44
45
# File 'lib/ElasticEmail/models/message_category.rb', line 43

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



50
51
52
53
# File 'lib/ElasticEmail/models/message_category.rb', line 50

def build_from_hash(value)
  return value if MessageCategory.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #MessageCategory"
end