Class: ElasticEmail::ContactStatus

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

Constant Summary collapse

TRANSACTIONAL =
"Transactional".freeze
ENGAGED =
"Engaged".freeze
ACTIVE =
"Active".freeze
BOUNCED =
"Bounced".freeze
UNSUBSCRIBED =
"Unsubscribed".freeze
ABUSE =
"Abuse".freeze
INACTIVE =
"Inactive".freeze
STALE =
"Stale".freeze
NOT_CONFIRMED =
"NotConfirmed".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class 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



31
32
33
# File 'lib/ElasticEmail/models/contact_status.rb', line 31

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



38
39
40
41
42
# File 'lib/ElasticEmail/models/contact_status.rb', line 38

def build_from_hash(value)
  constantValues = ContactStatus.constants.select { |c| ContactStatus::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #ContactStatus" if constantValues.empty?
  value
end