Class: RailsTracepointStack::Trace

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rails_tracepoint_stack/trace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trace_point:) ⇒ Trace

Returns a new instance of Trace.



15
16
17
# File 'lib/rails_tracepoint_stack/trace.rb', line 15

def initialize(trace_point:)
  @trace_point = trace_point
end

Instance Attribute Details

#depthObject

Returns the value of attribute depth.



8
9
10
# File 'lib/rails_tracepoint_stack/trace.rb', line 8

def depth
  @depth
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/rails_tracepoint_stack/trace.rb', line 7

def params
  @params
end

#trace_pointObject (readonly)

Returns the value of attribute trace_point.



7
8
9
# File 'lib/rails_tracepoint_stack/trace.rb', line 7

def trace_point
  @trace_point
end

Instance Method Details

#exceptionObject



35
36
37
38
39
# File 'lib/rails_tracepoint_stack/trace.rb', line 35

def exception
  return nil unless kind == :raise

  trace_point.raised_exception
end

#kindObject



19
20
21
# File 'lib/rails_tracepoint_stack/trace.rb', line 19

def kind
  trace_point.event
end

#return_valueObject



29
30
31
32
33
# File 'lib/rails_tracepoint_stack/trace.rb', line 29

def return_value
  return nil unless kind == :return

  trace_point.return_value
end