Class: FedexWebService::AddressVerificationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fedex_web_service/address_verification.rb

Overview

end Class AddressVerification

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(soap_response) ⇒ AddressVerificationResponse

Returns a new instance of AddressVerificationResponse.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/fedex_web_service/address_verification.rb', line 59

def initialize(soap_response)
  @soap_response = soap_response #so we can use it with other methods in this class

  address_results = address_results_an_array? ? @soap_response.addressResults.proposedAddressDetails[0] : @soap_response.addressResults.proposedAddressDetails

  self.responseString           = soap_response.notifications.severity
  self.changes                  = address_results.changes
  self.deliveryPointValidation  = address_results.deliveryPointValidation
  self.score                    = address_results.score.to_i
  self.residentialStatus        = address_results.residentialStatus 
  self.changedAddress           = address_results.address.streetLines.to_s
  self.changedCity              = address_results.address.city
  self.changedState             = address_results.address.stateOrProvinceCode
  self.changedPostal            = address_results.address.postalCode
  self.responses                = []

  set_other_responses if address_results_an_array?

end

Instance Attribute Details

#changedAddressObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def changedAddress
  @changedAddress
end

#changedCityObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def changedCity
  @changedCity
end

#changedPostalObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def changedPostal
  @changedPostal
end

#changedStateObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def changedState
  @changedState
end

#changesObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def changes
  @changes
end

#deliveryPointValidationObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def deliveryPointValidation
  @deliveryPointValidation
end

#residentialStatusObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def residentialStatus
  @residentialStatus
end

#responsesObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def responses
  @responses
end

#responseStringObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def responseString
  @responseString
end

#scoreObject

this is really just a data translation object. It receives a SOAP response (blech) and translates it into a Ruby object. Where it’s not blindingly obvious, I’ve included notes for each attribute



48
49
50
# File 'lib/fedex_web_service/address_verification.rb', line 48

def score
  @score
end