Class: AppMap::Trace::MethodReturn

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

Constant Summary

Constants inherited from MethodEvent

AppMap::Trace::MethodEvent::COUNTER_LOCK, AppMap::Trace::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

#return_valueObject

Returns the value of attribute return_value.



182
183
184
# File 'lib/appmap/trace/tracer.rb', line 182

def return_value
  @return_value
end

Class Method Details

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



185
186
187
188
189
190
191
192
193
194
# File 'lib/appmap/trace/tracer.rb', line 185

def build_from_tracepoint(mr = MethodReturn.new, tp, path, parent_id, elapsed)
  mr.tap do |_|
    mr.return_value = {
      class: tp.return_value.class.name,
      value: display_string(tp.return_value),
      object_id: tp.return_value.__id__
    }
    MethodReturnIgnoreValue.build_from_tracepoint(mr, tp, path, parent_id, elapsed)
  end
end

Instance Method Details

#to_hObject



197
198
199
200
201
# File 'lib/appmap/trace/tracer.rb', line 197

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