Class: V8::Weak::Ref
- Inherits:
-
Object
- Object
- V8::Weak::Ref
- Defined in:
- lib/v8/weak.rb
Instance Method Summary collapse
-
#initialize(object) ⇒ Ref
constructor
A new instance of Ref.
- #object ⇒ Object
Constructor Details
#initialize(object) ⇒ Ref
Returns a new instance of Ref.
20 21 22 |
# File 'lib/v8/weak.rb', line 20 def initialize(object) @ref = ::WeakRef.new(object) end |
Instance Method Details
#object ⇒ Object
23 24 25 26 27 |
# File 'lib/v8/weak.rb', line 23 def object @ref.__getobj__ rescue ::WeakRef::RefError nil end |