Class: MWS::Address

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Address

Returns a new instance of Address.



6
7
8
# File 'lib/mws/address.rb', line 6

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

Instance Attribute Details

#address_line_1Object

Returns the value of attribute address_line_1.



10
11
12
# File 'lib/mws/address.rb', line 10

def address_line_1
  @address_line_1
end

#address_line_2Object

Returns the value of attribute address_line_2.



10
11
12
# File 'lib/mws/address.rb', line 10

def address_line_2
  @address_line_2
end

#cityObject

Returns the value of attribute city.



10
11
12
# File 'lib/mws/address.rb', line 10

def city
  @city
end

#country_codeObject

Returns the value of attribute country_code.



10
11
12
# File 'lib/mws/address.rb', line 10

def country_code
  @country_code
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/mws/address.rb', line 10

def name
  @name
end

#postal_codeObject

Returns the value of attribute postal_code.



10
11
12
# File 'lib/mws/address.rb', line 10

def postal_code
  @postal_code
end

#state_or_province_codeObject

Returns the value of attribute state_or_province_code.



10
11
12
# File 'lib/mws/address.rb', line 10

def state_or_province_code
  @state_or_province_code
end

Instance Method Details

#to_hashObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mws/address.rb', line 12

def to_hash
  {
    :name => @name,
    :address_line_1 => @address_line_1,
    :address_line_2 => @address_line_2,
    :city => @city,
    :state_or_province_code => @state_or_province_code,
    :country_code => @country_code,
    :postal_code => @postal_code
  }
end