Sha256: a560471dfc97e51b0055383e51f0b98e73c9812a9246902a4aeee1125afbcdf5
Contents?: true
Size: 827 Bytes
Versions: 24
Compression:
Stored size: 827 Bytes
Contents
module ShopifyAPI class Connection < ActiveResource::Connection attr_reader :response module ResponseCapture def handle_response(response) @response = super end end include ResponseCapture module RequestNotification def request(method, path, *arguments) super.tap do |response| notify_about_request(response, arguments) end rescue => e notify_about_request(e.response, arguments) if e.respond_to?(:response) raise end def notify_about_request(response, arguments) ActiveSupport::Notifications.instrument("request.active_resource_detailed") do |payload| payload[:response] = response payload[:data] = arguments end end end include RequestNotification end end
Version data entries
24 entries across 24 versions & 1 rubygems