Module: ObjectTracer::Manageable

Included in:
ObjectTracer
Defined in:
lib/object_tracer/manageable.rb

Instance Method Summary collapse

Instance Method Details

#delete_device(device) ⇒ Object

disable given device and remove it from registered list



14
15
16
17
# File 'lib/object_tracer/manageable.rb', line 14

def delete_device(device)
  device.trace_point&.disable
  @devices -= [device]
end

#devicesObject

list all registered devices



9
10
11
# File 'lib/object_tracer/manageable.rb', line 9

def devices
  @devices
end

#reset!Object

reset everything to clean state and disable all devices



31
32
33
34
# File 'lib/object_tracer/manageable.rb', line 31

def reset!
  @suspend_new = false
  stop_all!
end

#stop_all!Object

stops all registered devices and remove them from registered list



20
21
22
# File 'lib/object_tracer/manageable.rb', line 20

def stop_all!
  @devices.each(&:stop!)
end

#suspend_newObject



4
5
6
# File 'lib/object_tracer/manageable.rb', line 4

def suspend_new
  @suspend_new
end

#suspend_new!Object

suspend enabling new trace points user can still create new Device instances, but they won’t be functional



26
27
28
# File 'lib/object_tracer/manageable.rb', line 26

def suspend_new!
  @suspend_new = true
end