Sha256: 3426236cead506fa17fbd4f7fd9df752d4ec62b0c1560ed748ad02d1a0bfd242

Contents?: true

Size: 642 Bytes

Versions: 13

Compression:

Stored size: 642 Bytes

Contents

module DHLEcommerceAPI
  class Connection < ActiveResource::Connection
    def request(method, path, *arguments)
      result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
        payload[:method] = method
        payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
        payload[:result] = http.send(method, path, *arguments)
        # debug outgoing request here if needed
      end

      handle_response(result)
    rescue Timeout::Error => e
      raise TimeoutError.new(e.message)
    rescue OpenSSL::SSL::SSLError => e
      raise SSLError.new(e.message)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dhl_ecommerce_api-0.1.13 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.12 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.11 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.9 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.8 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.7 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.6 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.5 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.4 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.3 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.2 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.1 lib/dhl_ecommerce_api/connection.rb
dhl_ecommerce_api-0.1.0 lib/dhl_ecommerce_api/connection.rb