Class: ElasticEmail::EncodingType

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

Constant Summary collapse

USER_PROVIDED =
"UserProvided".freeze
NONE =
"None".freeze
RAW7BIT =
"Raw7bit".freeze
RAW8BIT =
"Raw8bit".freeze
QUOTED_PRINTABLE =
"QuotedPrintable".freeze
BASE64 =
"Base64".freeze
UUE =
"Uue".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



26
27
28
# File 'lib/ElasticEmail/models/encoding_type.rb', line 26

def self.all_vars
  @all_vars ||= [USER_PROVIDED, NONE, RAW7BIT, RAW8BIT, QUOTED_PRINTABLE, BASE64, UUE].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



33
34
35
# File 'lib/ElasticEmail/models/encoding_type.rb', line 33

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



40
41
42
43
# File 'lib/ElasticEmail/models/encoding_type.rb', line 40

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