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.rb
Constant Summary
Constants inherited from Event::MethodEvent
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Event::MethodReturnIgnoreValue
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
best_class_name, build_from_invocation, custom_display_string, default_display_string, display_string, object_properties
Constructor Details
#initialize(response, parent_id, elapsed) ⇒ HTTPClientResponse
Returns a new instance of HTTPClientResponse.
59 60 61 62 63 64 65 66 |
# File 'lib/appmap/handler/net_http.rb', line 59 def initialize(response, parent_id, elapsed) super AppMap::Event.next_id_counter, :return, Thread.current.object_id self.status = response.code.to_i self.parent_id = parent_id self.elapsed = elapsed self.headers = AppMap::Util.select_headers(NetHTTP.response_headers(response)) end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
57 58 59 |
# File 'lib/appmap/handler/net_http.rb', line 57 def headers @headers end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
57 58 59 |
# File 'lib/appmap/handler/net_http.rb', line 57 def mime_type @mime_type end |
#status ⇒ Object
Returns the value of attribute status.
57 58 59 |
# File 'lib/appmap/handler/net_http.rb', line 57 def status @status end |
Instance Method Details
#to_h ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/appmap/handler/net_http.rb', line 68 def to_h super.tap do |h| h[:http_client_response] = { status_code: status, mime_type: mime_type, headers: headers }.compact end end |