Class: Byebug::DAP::Handles Private
- Inherits:
-
Object
- Object
- Byebug::DAP::Handles
- Defined in:
- lib/byebug/dap/helpers/handles.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Tracks opaque handles used by DAP.
Instance Method Summary collapse
-
#<<(entry) ⇒ std:Integer
private
Add a new entry.
-
#[](id) ⇒ Object
private
Retrieve the entry with the specified handle.
-
#clear! ⇒ Object
private
Delete all handles.
-
#initialize ⇒ Handles
constructor
private
A new instance of Handles.
Constructor Details
#initialize ⇒ Handles
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Handles.
6 7 8 9 |
# File 'lib/byebug/dap/helpers/handles.rb', line 6 def initialize @mu = Mutex.new @entries = [] end |
Instance Method Details
#<<(entry) ⇒ std:Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add a new entry.
25 26 27 28 29 30 |
# File 'lib/byebug/dap/helpers/handles.rb', line 25 def <<(entry) sync do @entries << entry @entries.size end end |
#[](id) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retrieve the entry with the specified handle.
19 20 21 |
# File 'lib/byebug/dap/helpers/handles.rb', line 19 def [](id) sync { @entries[id-1] } end |
#clear! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Delete all handles.
12 13 14 |
# File 'lib/byebug/dap/helpers/handles.rb', line 12 def clear! sync { @entries = []; nil } end |