Module: TappingDevice::Manageable
- Included in:
- TappingDevice
- Defined in:
- lib/tapping_device/manageable.rb
Instance Method Summary collapse
-
#delete_device(device) ⇒ Object
disable given device and remove it from registered list.
-
#devices ⇒ Object
list all registered devices.
-
#reset! ⇒ Object
reset everything to clean state and disable all devices.
-
#stop_all! ⇒ Object
stops all registered devices and remove them from registered list.
- #suspend_new ⇒ Object
-
#suspend_new! ⇒ Object
suspend enabling new trace points user can still create new Device instances, but they won’t be functional.
Instance Method Details
#delete_device(device) ⇒ Object
disable given device and remove it from registered list
14 15 16 17 |
# File 'lib/tapping_device/manageable.rb', line 14 def delete_device(device) device.trace_point&.disable @devices -= [device] end |
#devices ⇒ Object
list all registered devices
9 10 11 |
# File 'lib/tapping_device/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/tapping_device/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/tapping_device/manageable.rb', line 20 def stop_all! @devices.each(&:stop!) end |
#suspend_new ⇒ Object
4 5 6 |
# File 'lib/tapping_device/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/tapping_device/manageable.rb', line 26 def suspend_new! @suspend_new = true end |