Module: ShopifyAPI::Connection::RequestNotification
- Included in:
- ShopifyAPI::Connection
- Defined in:
- lib/shopify_api/connection.rb
Instance Method Summary collapse
- #notify_about_request(method, path, response, arguments) ⇒ Object
- #request(method, path, *arguments) ⇒ Object
Instance Method Details
#notify_about_request(method, path, response, arguments) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/shopify_api/connection.rb', line 23 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) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/shopify_api/connection.rb', line 14 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 |