Method: Fedex::Address#initialize

Defined in:
lib/fedex/address.rb

#initialize(options) ⇒ Address

Returns a new instance of Address.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fedex/address.rb', line 8

def initialize(options)
  @changes   = options[:changes]
  @score     = options[:score].to_i
  @confirmed = options[:delivery_point_validation] == "CONFIRMED"
  @available = options[:delivery_point_validation] != "UNAVAILABLE"

  @status      = options[:residential_status]
  @residential = status == "RESIDENTIAL"
  @business    = status == "BUSINESS"

  address        = options[:address]

  @street_lines  = address[:street_lines]
  @city          = address[:city]
  @state         = address[:state_or_province_code]
  @province_code = address[:state_or_province_code]
  @postal_code   = address[:postal_code]
  @country_code  = address[:country_code]

  @options = options
end