Class: Responsys::Api::Object::Recipient

Inherits:
Object
  • Object
show all
Includes:
Responsys::Api::Object
Defined in:
lib/responsys/api/object/recipient.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Recipient

Returns a new instance of Recipient.



8
9
10
11
12
13
14
15
# File 'lib/responsys/api/object/recipient.rb', line 8

def initialize(options = {})
  @list_name = options[:listName] || InteractObject.new("", "")
  @recipient_id = options[:recipientId] || ""
  @customer_id = options[:customerId] || ""
  @email_address = options[:emailAddress] || ""
  @mobile_number = options[:mobileNumber] || ""
  @email_format = options[:emailFormat] || EmailFormat.new
end

Instance Attribute Details

#customer_idObject

Returns the value of attribute customer_id.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def customer_id
  @customer_id
end

#email_addressObject

Returns the value of attribute email_address.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def email_address
  @email_address
end

#email_formatObject

Returns the value of attribute email_format.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def email_format
  @email_format
end

#list_nameObject

Returns the value of attribute list_name.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def list_name
  @list_name
end

#mobile_numberObject

Returns the value of attribute mobile_number.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def mobile_number
  @mobile_number
end

#recipient_idObject

Returns the value of attribute recipient_id.



6
7
8
# File 'lib/responsys/api/object/recipient.rb', line 6

def recipient_id
  @recipient_id
end

Instance Method Details

#to_apiObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/responsys/api/object/recipient.rb', line 17

def to_api
  { 
    listName: @list_name.to_api,
    recipientId: @recipient_id.to_i,
    customerId: @customer_id.to_s,
    emailAddress: @email_address.to_s,
    mobileNumber: @mobile_number.to_s,
    emailFormat: @email_format.to_api
  }
end