Class: ObjectTracer::Trackers::PassedTracker

Inherits:
ObjectTracer show all
Defined in:
lib/object_tracer/trackers/passed_tracker.rb

Overview

PassedTracker tracks calls that use the target object as an argument

Constant Summary

Constants inherited from ObjectTracer

CALLER_START_POINT, C_CALLER_START_POINT, VERSION

Instance Attribute Summary

Attributes inherited from ObjectTracer

#calls, #options, #target, #trace_point

Instance Method Summary collapse

Methods inherited from ObjectTracer

config, #create_child_device, #descendants, #initialize, #root_device, #set_block, #stop!, #stop_when, #track, #with

Methods included from Manageable

#delete_device, #devices, #reset!, #stop_all!, #suspend_new, #suspend_new!

Methods included from Output::Helpers

#and_output, #and_print, #and_write

Constructor Details

This class inherits a constructor from ObjectTracer

Instance Method Details

#filter_condition_satisfied?(tp) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
13
# File 'lib/object_tracer/trackers/passed_tracker.rb', line 5

def filter_condition_satisfied?(tp)
  collect_arguments(tp).values.any? do |value|
    # during comparison, Ruby might perform data type conversion like calling `to_sym` on the value
    # but not every value supports every conversion methods
    target == value rescue false
  end
rescue
  false
end