Class: FedexLocationService::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/fedex_location_service/response.rb

Class Method Summary collapse

Class Method Details

.build(message) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/fedex_location_service/response.rb', line 3

def self.build(message)
  if message.class == Savon::Response
    message.to_hash
  elsif message.class == Savon::SOAPFault
    original_message = message.to_hash

    custom_error_message = {
      search_locations_reply: {
        highest_severity: 'FATAL'
      }
    }

    original_message.merge(custom_error_message)
  end
end