Class: AppMap::Rails::RequestHandler::HTTPServerResponse
- Inherits:
-
Event::MethodReturnIgnoreValue
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- Event::MethodReturnIgnoreValue
- AppMap::Rails::RequestHandler::HTTPServerResponse
- Defined in:
- lib/appmap/rails/request_handler.rb
Constant Summary
Constants inherited from Event::MethodEvent
Instance Attribute Summary collapse
-
#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) ⇒ HTTPServerResponse
constructor
A new instance of HTTPServerResponse.
- #to_h ⇒ Object
Methods inherited from Event::MethodReturnIgnoreValue
Methods inherited from Event::MethodEvent
build_from_invocation, display_string
Constructor Details
#initialize(response, parent_id, elapsed) ⇒ HTTPServerResponse
64 65 66 67 68 69 70 71 |
# File 'lib/appmap/rails/request_handler.rb', line 64 def initialize(response, parent_id, elapsed) super AppMap::Event.next_id_counter, :return, Thread.current.object_id self.status = response.status self.mime_type = response.headers['Content-Type'] self.parent_id = parent_id self.elapsed = elapsed end |
Instance Attribute Details
#mime_type ⇒ Object
Returns the value of attribute mime_type.
62 63 64 |
# File 'lib/appmap/rails/request_handler.rb', line 62 def mime_type @mime_type end |
#status ⇒ Object
Returns the value of attribute status.
62 63 64 |
# File 'lib/appmap/rails/request_handler.rb', line 62 def status @status end |
Instance Method Details
#to_h ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/appmap/rails/request_handler.rb', line 73 def to_h super.tap do |h| h[:http_server_response] = { status: status, mime_type: mime_type }.compact end end |