Class: TraceViz::TraceData::TracePointBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_viz/trace_data/trace_point_builder.rb

Class Method Summary collapse

Class Method Details

.build(tp) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/trace_viz/trace_data/trace_point_builder.rb', line 10

def build(tp)
  case tp.event
  when :call
    TracePoint::MethodCall.new(tp)
  when :return
    TracePoint::MethodReturn.new(tp)
  else
    raise ArgumentError, "Unsupported TracePoint event: #{tp.event}"
  end
end