Class: ActiveResource::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/active_resource/connection_ext.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) response (readonly)

Returns the value of attribute response



6
7
8
# File 'lib/active_resource/connection_ext.rb', line 6

def response
  @response
end

Instance Method Details

- (Object) detailed_log_subscriber(response, arguments)



21
22
23
24
25
26
# File 'lib/active_resource/connection_ext.rb', line 21

def detailed_log_subscriber(response, arguments)
  ActiveSupport::Notifications.instrument("request.active_resource_detailed") do |payload|
    payload[:response] = response
    payload[:data]     = arguments
  end
end

- (Object) handle_response_with_response_capture(response)



8
9
10
# File 'lib/active_resource/connection_ext.rb', line 8

def handle_response_with_response_capture(response)
  @response = handle_response_without_response_capture(response)
end

- (Object) request_with_detailed_log_subscriber(method, path, *arguments)



12
13
14
15
16
17
18
19
# File 'lib/active_resource/connection_ext.rb', line 12

def request_with_detailed_log_subscriber(method, path, *arguments)
  result = request_without_detailed_log_subscriber(method, path, *arguments)
  detailed_log_subscriber(result, arguments)
  result
rescue => e
  detailed_log_subscriber(e.response, arguments) if e.respond_to?(:response)
  raise
end