Class: AppMap::Handler::HTTPClientResponse
- Inherits:
-
Event::MethodReturnIgnoreValue
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- Event::MethodReturnIgnoreValue
- AppMap::Handler::HTTPClientResponse
- Defined in:
- lib/appmap/handler/net_http_handler.rb
Constant Summary
Constants inherited from Event::MethodEvent
Event::MethodEvent::MAX_ARRAY_ENUMERATION, Event::MethodEvent::MAX_HASH_ENUMERATION, Event::MethodEvent::MAX_STRING_LENGTH
Constants included from ValueInspector
ValueInspector::MAX_ARRAY_ELEMENTS, ValueInspector::MAX_DEPTH
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Event::MethodReturnIgnoreValue
#elapsed, #elapsed_instrumentation, #parent_id
Attributes inherited from Event::MethodEventStruct
Instance Method Summary collapse
-
#initialize(response, parent_id, elapsed) ⇒ HTTPClientResponse
constructor
A new instance of HTTPClientResponse.
- #to_h ⇒ Object
Methods inherited from Event::MethodReturnIgnoreValue
Methods inherited from Event::MethodEvent
add_schema, add_size, build_from_invocation, custom_display_string, default_display_string, display_string, encode_display_string, #ready?
Methods included from ValueInspector
#best_class_name, #detect_schema, #detect_size
Constructor Details
#initialize(response, parent_id, elapsed) ⇒ HTTPClientResponse
Returns a new instance of HTTPClientResponse.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/appmap/handler/net_http_handler.rb', line 62 def initialize(response, parent_id, elapsed) super AppMap::Event.next_id_counter, :return, Thread.current.object_id if response self.status = response.code.to_i self.headers = NetHTTPHandler.copy_headers(response) else self.headers = {} end self.parent_id = parent_id self.elapsed = elapsed end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
60 61 62 |
# File 'lib/appmap/handler/net_http_handler.rb', line 60 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
60 61 62 |
# File 'lib/appmap/handler/net_http_handler.rb', line 60 def status @status end |
Instance Method Details
#to_h ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/appmap/handler/net_http_handler.rb', line 75 def to_h super.tap do |h| h[:http_client_response] = { status_code: status, headers: headers }.compact end end |