Class: AppMap::Handler::Rails::RequestHandler::HTTPServerResponse
- Inherits:
-
Event::MethodReturnIgnoreValue
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- Event::MethodReturnIgnoreValue
- AppMap::Handler::Rails::RequestHandler::HTTPServerResponse
- Defined in:
- lib/appmap/handler/rails/request_handler.rb
Constant Summary
Constants inherited from Event::MethodEvent
Event::MethodEvent::MAX_ARRAY_ENUMERATION, Event::MethodEvent::MAX_HASH_ENUMERATION, Event::MethodEvent::MAX_STRING_LENGTH
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
Attributes inherited from Event::MethodEventStruct
Instance Method Summary collapse
-
#initialize(response, parent_id, elapsed) ⇒ HTTPServerResponse
constructor
A new instance of HTTPServerResponse.
- #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, encode_display_string, object_properties, #ready?
Constructor Details
#initialize(response, parent_id, elapsed) ⇒ HTTPServerResponse
Returns a new instance of HTTPServerResponse.
73 74 75 76 77 78 79 80 |
# File 'lib/appmap/handler/rails/request_handler.rb', line 73 def initialize(response, parent_id, elapsed) super AppMap::Event.next_id_counter, :return, Thread.current.object_id self.status = response.status self.parent_id = parent_id self.elapsed = elapsed self.headers = response.headers.dup end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
71 72 73 |
# File 'lib/appmap/handler/rails/request_handler.rb', line 71 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
71 72 73 |
# File 'lib/appmap/handler/rails/request_handler.rb', line 71 def status @status end |
Instance Method Details
#to_h ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'lib/appmap/handler/rails/request_handler.rb', line 82 def to_h super.tap do |h| h[:http_server_response] = { status_code: status, headers: headers }.compact end end |