Class: DRb::WeakIdConv
Overview
To use WeakIdConv:
DRb.start_service(nil, nil, {:idconv => DRb::WeakIdConv.new})
Defined Under Namespace
Classes: WeakSet
Instance Method Summary collapse
-
#initialize ⇒ WeakIdConv
constructor
A new instance of WeakIdConv.
-
#to_id(obj) ⇒ Object
:nodoc:.
-
#to_obj(ref) ⇒ Object
:nodoc:.
Constructor Details
#initialize ⇒ WeakIdConv
Returns a new instance of WeakIdConv.
43 44 45 46 |
# File 'lib/drb/weakidconv.rb', line 43 def initialize() super() @weak_set = WeakSet.new end |
Instance Method Details
#to_id(obj) ⇒ Object
:nodoc:
53 54 55 |
# File 'lib/drb/weakidconv.rb', line 53 def to_id(obj) # :nodoc: return @weak_set.add(obj) end |
#to_obj(ref) ⇒ Object
:nodoc:
48 49 50 51 |
# File 'lib/drb/weakidconv.rb', line 48 def to_obj(ref) # :nodoc: return super if ref.nil? @weak_set.fetch(ref) end |