Class: PrivatePlease::Tracking::TracePointProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/private_please/tracking/trace_point_processor.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ TracePointProcessor

Returns a new instance of TracePointProcessor.



11
12
13
14
15
16
# File 'lib/private_please/tracking/trace_point_processor.rb', line 11

def initialize(config)
  @config                   = config

  @latest_tracepoints       = Utils::TwoLevelStack.new
  @encountered_method_calls = Storage::CalledMethodsMemoryStore.new
end

Instance Method Details

#process(tp) ⇒ Object



18
19
20
21
22
# File 'lib/private_please/tracking/trace_point_processor.rb', line 18

def process(tp)
  return if untracked_code?(tp.path)
  remember_trace_point tp
  store_method_call_details if tp.event == :call
end

#resultObject



24
25
26
# File 'lib/private_please/tracking/trace_point_processor.rb', line 24

def result
  Result.new(@encountered_method_calls)
end