9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/friendly_shipping/services/ups/parse_address_classification_response.rb', line 9
def self.call(request:, response:)
parsing_result = ParseXMLResponse.call(
request: request,
response: response,
expected_root_tag: 'AddressValidationResponse'
)
parsing_result.bind do |xml|
address_type = xml.at('AddressClassification/Description')&.text&.downcase
Success(
FriendlyShipping::ApiResult.new(
address_type,
original_request: request,
original_response: response
)
)
end
end
|