class ShipCompliant::Address
ShipCompliant::Address
¶ ↑
This is a value object that wraps an address node. BillTo
and ShipTo
.
address = ShipCompliant::Address.new(city: 'Boston', state: 'MA') address.city #=> 'Boston' address.state #=> 'MA'
Public Instance Methods
city()
click to toggle source
Returns the suggested city.
# File lib/ship_compliant/address.rb, line 12 def city address[:city] end
company()
click to toggle source
Returns the company.
# File lib/ship_compliant/address.rb, line 53 def company address[:company] end
country()
click to toggle source
Returns the country.
# File lib/ship_compliant/address.rb, line 27 def country address[:country] end
county()
click to toggle source
Returns the suggested county.
# File lib/ship_compliant/address.rb, line 17 def county address[:county] end
date_of_birth()
click to toggle source
Returns the date of birth.
# File lib/ship_compliant/address.rb, line 83 def date_of_birth address[:date_of_birth] end
email()
click to toggle source
Returns the email address.
# File lib/ship_compliant/address.rb, line 78 def email address[:email] end
fax()
click to toggle source
Returns the fax.
# File lib/ship_compliant/address.rb, line 73 def fax address[:fax] end
first_name()
click to toggle source
Returns the first name.
# File lib/ship_compliant/address.rb, line 58 def first_name address[:first_name] end
last_name()
click to toggle source
Returns the last name.
# File lib/ship_compliant/address.rb, line 63 def last_name address[:last_name] end
phone()
click to toggle source
Returns the phone.
# File lib/ship_compliant/address.rb, line 68 def phone address[:phone] end
state()
click to toggle source
Returns the suggested state.
# File lib/ship_compliant/address.rb, line 22 def state address[:state] end
street1()
click to toggle source
Returns the suggested street.
# File lib/ship_compliant/address.rb, line 32 def street1 address[:street1] end
street2()
click to toggle source
Returns the suggested street line 2.
# File lib/ship_compliant/address.rb, line 37 def street2 address[:street2] end
zip1()
click to toggle source
Returns the suggested zip code.
# File lib/ship_compliant/address.rb, line 42 def zip1 address[:zip1].to_i end
zip2()
click to toggle source
Returns the suggested zip code extension.
# File lib/ship_compliant/address.rb, line 47 def zip2 return nil if address[:zip2].blank? address[:zip2].to_i end