module ShopifyAPI::Connection::RequestNotification

Public Instance Methods

notify_about_request(method, path, response, arguments) click to toggle source
# File lib/shopify_api/connection.rb, line 24
def notify_about_request(method, path, response, arguments)
  ActiveSupport::Notifications.instrument("request.active_resource_detailed") do |payload|
    payload[:method]   = method
    payload[:path]     = path
    payload[:response] = response
    payload[:data]     = arguments
  end
end
request(method, path, *arguments) click to toggle source
Calls superclass method
# File lib/shopify_api/connection.rb, line 15
def request(method, path, *arguments)
  super.tap do |response|
    notify_about_request(method, path, response, arguments)
  end
rescue => e
  notify_about_request(method, path, e.response, arguments) if e.respond_to?(:response)
  raise
end