Class: AppMap::Trace::EventHandler::RackHandlerWebrick::Return

Inherits:
MethodReturnIgnoreValue show all
Defined in:
lib/appmap/trace/event_handler/rack_handler_webrick.rb

Constant Summary

Constants inherited from MethodEvent

MethodEvent::COUNTER_LOCK, MethodEvent::LIMIT

Instance Attribute Summary collapse

Attributes inherited from MethodReturnIgnoreValue

#elapsed, #parent_id

Attributes inherited from MethodEventStruct

#defined_class, #event, #id, #lineno, #method_id, #path, #static, #thread_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MethodEvent

display_string, next_id, value_in_binding

Instance Attribute Details

#http_server_responseObject

Returns the value of attribute http_server_response.



40
41
42
# File 'lib/appmap/trace/event_handler/rack_handler_webrick.rb', line 40

def http_server_response
  @http_server_response
end

Class Method Details

.build_from_tracepoint(mr = Return.new, tp, path, parent_id, elapsed) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/appmap/trace/event_handler/rack_handler_webrick.rb', line 43

def build_from_tracepoint(mr = Return.new, tp, path, parent_id, elapsed)
  mr.tap do |_|
    res = value_in_binding(tp, :res)

    mr.http_server_response = {
      status: res.status
    }

    MethodReturnIgnoreValue.build_from_tracepoint(mr, tp, path, parent_id, elapsed)
  end
end

Instance Method Details

#to_hObject



56
57
58
59
60
# File 'lib/appmap/trace/event_handler/rack_handler_webrick.rb', line 56

def to_h
  super.tap do |h|
    h[:http_server_response] = http_server_response
  end
end