Class: TraceViz::TraceData::TracePoint::MethodReturn
- Defined in:
- lib/trace_viz/trace_data/trace_point/method_return.rb
Instance Attribute Summary collapse
-
#method_call ⇒ Object
readonly
Returns the value of attribute method_call.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Base
#action, #event, #klass, #line_number, #memory_id, #path, #trace_point
Attributes included from TraceViz::Traits::Identifiable
Attributes inherited from Node
Attributes included from TraceViz::Traits::TimeTrackable
Attributes included from TraceViz::Traits::DepthTrackable
Instance Method Summary collapse
- #duration ⇒ Object
-
#initialize(trace_point) ⇒ MethodReturn
constructor
A new instance of MethodReturn.
- #link(method_call) ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
Methods included from TraceViz::Traits::Identifiable
Methods inherited from Node
Methods inherited from Base
#action, #event, #key, #klass, #line_number, #path
Methods included from TraceViz::Traits::TimeTrackable
Methods included from TraceViz::Traits::DepthTrackable
Methods included from Helpers::ConfigHelper
#config, #fetch_general_config
Constructor Details
#initialize(trace_point) ⇒ MethodReturn
Returns a new instance of MethodReturn.
11 12 13 14 15 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 11 def initialize(trace_point) super(trace_point) populate_result end |
Instance Attribute Details
#method_call ⇒ Object (readonly)
Returns the value of attribute method_call.
9 10 11 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 9 def method_call @method_call end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 9 def result @result end |
Instance Method Details
#duration ⇒ Object
22 23 24 25 26 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 22 def duration return 0 unless method_call - method_call. end |
#link(method_call) ⇒ Object
17 18 19 20 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 17 def link(method_call) @method_call = method_call method_call.link(self) end |
#to_h ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/trace_viz/trace_data/trace_point/method_return.rb', line 28 def to_h super.merge( { result: result, method_call_id: method_call&.id, }, ) end |