Class: AppMap::Handler::NetHTTPHandler
- Inherits:
-
AppMap::Hook::Method
- Object
- AppMap::Hook::Method
- AppMap::Handler::NetHTTPHandler
- Defined in:
- lib/appmap/handler/net_http_handler.rb
Overview
Handler class for HTTP requests. Emits HTTP request events instead of method calls.
Constant Summary
Constants inherited from AppMap::Hook::Method
AppMap::Hook::Method::HOOK_DISABLE_KEY
Constants included from AppMap::Hook::RecordAround
AppMap::Hook::RecordAround::APPMAP_OUTPUT_DIR
Instance Attribute Summary
Attributes inherited from AppMap::Hook::Method
#arity, #hook_class, #hook_method, #hook_package, #parameters, #record_around
Class Method Summary collapse
Instance Method Summary collapse
- #handle_call(receiver, args) ⇒ Object
- #handle_return(call_event_id, elapsed, return_value, exception) ⇒ Object
Methods inherited from AppMap::Hook::Method
Methods included from AppMap::Hook::RecordAround
#record_around?, #record_around_after, #record_around_before
Constructor Details
This class inherits a constructor from AppMap::Hook::Method
Class Method Details
.copy_headers(obj) ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/appmap/handler/net_http_handler.rb', line 88 def self.copy_headers(obj) {}.tap do |headers| obj.each_header do |key, value| key = key.split('-').map(&:capitalize).join('-') headers[key] = value end end end |
Instance Method Details
#handle_call(receiver, args) ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/appmap/handler/net_http_handler.rb', line 97 def handle_call(receiver, args) # request will call itself again in a start block if it's not already started. return unless receiver.started? http = receiver request = args.first HTTPClientRequest.new(http, request) end |
#handle_return(call_event_id, elapsed, return_value, exception) ⇒ Object
106 107 108 |
# File 'lib/appmap/handler/net_http_handler.rb', line 106 def handle_return(call_event_id, elapsed, return_value, exception) HTTPClientResponse.new(return_value, call_event_id, elapsed) end |