Class: Xpost::Models::Address

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/xpost/models/address.rb

Constant Summary collapse

REQUIRED_ADDRESS_PARAMETERS =
Set[:name, :shipment, :line_1, :city, :state, :postal_code, :country]
OPTIONAL_ADDRESS_PARAMETERS =
Set[:company, :title, :email, :phone_number, :mobile_number, :fax_number,
:district, :line_2, :remarks]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Address

Returns a new instance of Address.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/xpost/models/address.rb', line 18

def initialize(options = {})
  @shipment       = options[:shipment]
  @name           = options[:name]
  @email          = options[:email]
  @phone_number   = options[:phone_number]
  @mobile_number  = options[:mobile_number]
  @fax_number     = options[:fax_number]
  @company        = options[:company]
  @title          = options[:title]
  @line_1         = options[:line_1]
  @line_2         = options[:line_2]
  @city           = options[:city]
  @district       = options[:district]
  @state          = options[:state]
  @postal_code    = options[:postal_code]
  @country        = options[:country]
  @remarks        = options[:remarks]
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def city
  @city
end

#companyObject

Returns the value of attribute company.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def company
  @company
end

#countryObject

Returns the value of attribute country.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def country
  @country
end

#districtObject

Returns the value of attribute district.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def district
  @district
end

#emailObject

Returns the value of attribute email.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def email
  @email
end

#fax_numberObject

Returns the value of attribute fax_number.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def fax_number
  @fax_number
end

#line_1Object

Returns the value of attribute line_1.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def line_1
  @line_1
end

#line_2Object

Returns the value of attribute line_2.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def line_2
  @line_2
end

#mobile_numberObject

Returns the value of attribute mobile_number.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def mobile_number
  @mobile_number
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def name
  @name
end

#phone_numberObject

Returns the value of attribute phone_number.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def phone_number
  @phone_number
end

#postal_codeObject

Returns the value of attribute postal_code.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def postal_code
  @postal_code
end

#remarksObject

Returns the value of attribute remarks.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def remarks
  @remarks
end

#shipmentObject

Returns the value of attribute shipment.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def shipment
  @shipment
end

#stateObject

Returns the value of attribute state.



13
14
15
# File 'lib/xpost/models/address.rb', line 13

def state
  @state
end

#titleObject

Returns the value of attribute title.



14
15
16
# File 'lib/xpost/models/address.rb', line 14

def title
  @title
end