Class: Smartsend::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/smartsend/address.rb

Direct Known Subclasses

Receiver, Sender

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Address

Returns a new instance of Address.



6
7
8
9
10
# File 'lib/smartsend/address.rb', line 6

def initialize(args={})
  args.each do |k, v|
    instance_variable_set "@#{k}", v
  end
end

Instance Attribute Details

#address_line1Object

Returns the value of attribute address_line1.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def address_line1
  @address_line1
end

#address_line2Object

Returns the value of attribute address_line2.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def address_line2
  @address_line2
end

#cityObject

Returns the value of attribute city.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def city
  @city
end

#companyObject

Returns the value of attribute company.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def company
  @company
end

#countryObject

Returns the value of attribute country.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def country
  @country
end

#emailObject

Returns the value of attribute email.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def email
  @email
end

#internal_idObject

Returns the value of attribute internal_id.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def internal_id
  @internal_id
end

#internal_referenceObject

Returns the value of attribute internal_reference.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def internal_reference
  @internal_reference
end

#name_line1Object

Returns the value of attribute name_line1.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def name_line1
  @name_line1
end

#name_line2Object

Returns the value of attribute name_line2.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def name_line2
  @name_line2
end

#postal_codeObject

Returns the value of attribute postal_code.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def postal_code
  @postal_code
end

#smsObject

Returns the value of attribute sms.



2
3
4
# File 'lib/smartsend/address.rb', line 2

def sms
  @sms
end

Instance Method Details

#serializeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/smartsend/address.rb', line 12

def serialize
  {
    :internal_id        => internal_id,
    :internal_reference => internal_reference,
    :company            => company,
    :name_line1         => name_line1,
    :name_line2         => name_line2,
    :address_line1      => address_line1,
    :address_line2      => address_line2,
    :postal_code        => postal_code,
    :city               => city,
    :country            => country,
    :sms                => sms,
    :email              => email
  }
end