Class: AppMap::Handler::Rails::RequestHandler::HTTPServerResponse
- Inherits:
-
Event::MethodReturn
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- Event::MethodReturnIgnoreValue
- Event::MethodReturn
- 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::MethodReturn
Attributes inherited from Event::MethodReturnIgnoreValue
#elapsed, #elapsed_instrumentation, #parent_id
Attributes inherited from Event::MethodEventStruct
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Event::MethodEvent
add_schema, add_size, best_class_name, custom_display_string, default_display_string, display_string, encode_display_string, #ready?
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 |
Class Method Details
.build_from_invocation(parent_id, return_value, elapsed, response, event: HTTPServerResponse.new) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/appmap/handler/rails/request_handler.rb', line 74 def build_from_invocation(parent_id, return_value, elapsed, response, event: HTTPServerResponse.new) event ||= HTTPServerResponse.new event.status = response[:status] || response.status event.headers = (response[:headers] || response.headers).dup AppMap::Event::MethodReturn.build_from_invocation parent_id, return_value, nil, elapsed: elapsed, event: event, parameter_schema: true 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 |