Class: Riser::Resource::Proxy
- Inherits:
-
Delegator
- Object
- Delegator
- Riser::Resource::Proxy
- Includes:
- DRb::DRbUndumped, Delegatable, DelegateUnrefAlias
- Defined in:
- lib/riser/resource.rb
Instance Method Summary collapse
- #__unref__ ⇒ Object
-
#initialize(manager, unref_alias_set) ⇒ Proxy
constructor
A new instance of Proxy.
Methods included from DelegateUnrefAlias
#method_missing, #respond_to_missing?
Methods included from Delegatable
Constructor Details
#initialize(manager, unref_alias_set) ⇒ Proxy
Returns a new instance of Proxy.
121 122 123 124 125 126 127 |
# File 'lib/riser/resource.rb', line 121 def initialize(manager, unref_alias_set) @manager = manager @unref_alias_set = unref_alias_set # if an exception occurs at `@create.call', the proxy should not be referenced. super(@manager.ref_object) @manager.ref_proxy(self) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Riser::Resource::DelegateUnrefAlias
Instance Method Details
#__unref__ ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/riser/resource.rb', line 129 def __unref__ delegated = true __getobj__{ delegated = false } if (delegated) then __setobj__(nil) @manager.unref_proxy(self) # even if an exception occurs at `@destroy.call', the proxy should be unreferenced. @manager.unref_object end nil end |