Class: Farce::WeakRef
- Inherits:
-
Delegator
- Object
- Delegator
- Farce::WeakRef
- Includes:
- Internal::MarshalSupport::WeakRef
- Defined in:
- lib/farce/weak_ref.rb,
lib/farce/integrations/active_support/duplicable.rb
Overview
Drop-in replacement for Ruby's WeakRef class that is Ractor-friendly.
Constant Summary collapse
- RefError =
Alias for Farce::WeakRefError to mimic
::WeakRef::RefError WeakRefError
ActiveSupport Integration collapse
-
#duplicable? ⇒ Boolean
True.
Instance Method Summary collapse
-
#initialize(value) ⇒ WeakRef
constructor
A new instance of WeakRef.
-
#weakref_alive? ⇒ Boolean
True if the referenced object is still alive and reachable.
Constructor Details
Instance Method Details
#duplicable? ⇒ Boolean
Note:
This methods is only available if ActiveSupport has been loaded.
Returns true.
24 |
# File 'lib/farce/integrations/active_support/duplicable.rb', line 24 def duplicable? = true |
#weakref_alive? ⇒ Boolean
Returns true if the referenced object is still alive and reachable.
55 |
# File 'lib/farce/weak_ref.rb', line 55 def weakref_alive? = @value.alive? |