Class: FriendlyShipping::Services::UpsFreight::LabelEmailOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/ups_freight/label_email_options.rb

Constant Summary collapse

EMAIL_TYPES =
{
  ship_notification: '001',
  delivery_notification: '002',
  exception_notification: '003',
  bol_labels: '004'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:, email_type:, undeliverable_email:, subject: nil, body: nil) ⇒ LabelEmailOptions

Returns a new instance of LabelEmailOptions.



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 20

def initialize(
  email:,
  email_type:,
  undeliverable_email:,
  subject: nil,
  body: nil
)
  @email = email
  @email_type = email_type
  @undeliverable_email = undeliverable_email
  @subject = subject
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



14
15
16
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 14

def body
  @body
end

#emailObject (readonly)

Returns the value of attribute email.



14
15
16
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 14

def email
  @email
end

#email_typeObject (readonly)

Returns the value of attribute email_type.



14
15
16
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 14

def email_type
  @email_type
end

#subjectObject (readonly)

Returns the value of attribute subject.



14
15
16
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 14

def subject
  @subject
end

#undeliverable_emailObject (readonly)

Returns the value of attribute undeliverable_email.



14
15
16
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 14

def undeliverable_email
  @undeliverable_email
end

Instance Method Details

#email_type_codeObject



34
35
36
# File 'lib/friendly_shipping/services/ups_freight/label_email_options.rb', line 34

def email_type_code
  EMAIL_TYPES.fetch(email_type)
end