Sha256: 07d1f4f51c398288c69bda3bd4fae94f6ee05a9e248973727843f6fd028f8531

Contents?: true

Size: 958 Bytes

Versions: 3

Compression:

Stored size: 958 Bytes

Contents

module Exlibris
  module Primo
    module WebService
      module Response
        class Base
          include Abstract
          include Error
          include Namespaces
          include Util
          include XmlUtil
          self.abstract = true

          attr_reader :savon_response, :soap_action, :code, :body
          protected :savon_response, :soap_action

          def initialize savon_response, soap_action
            super
            @savon_response = savon_response
            @code = savon_response.http.code
            @body = savon_response.http.body
            @soap_action = soap_action
            # Primo's XML is unescaped trash that Nokogiri chokes on.
            # Force & to & and avoid double escaping
            # This is a complete HACK.
            @raw_xml = savon_response.body[response_key][return_key].
              gsub('&', '&').gsub('&', '&')
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-primo-1.1.3 lib/exlibris/primo/web_service/response/base.rb
exlibris-primo-1.1.2 lib/exlibris/primo/web_service/response/base.rb
exlibris-primo-1.1.1 lib/exlibris/primo/web_service/response/base.rb