Class: V8::Weak::WeakValueMap
- Inherits:
-
Object
- Object
- V8::Weak::WeakValueMap
- Defined in:
- lib/v8/weak.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ WeakValueMap
constructor
A new instance of WeakValueMap.
Constructor Details
#initialize ⇒ WeakValueMap
Returns a new instance of WeakValueMap.
31 32 33 |
# File 'lib/v8/weak.rb', line 31 def initialize @values = {} end |
Class Method Details
.ensure_cleanup(values, key, ref) ⇒ Object
48 49 50 51 52 |
# File 'lib/v8/weak.rb', line 48 def self.ensure_cleanup(values,key,ref) proc { values.delete(key) if values[key] == ref } end |
Instance Method Details
#[](key) ⇒ Object
35 36 37 38 39 |
# File 'lib/v8/weak.rb', line 35 def [](key) if ref = @values[key] ref.object end end |