Class: Dcmgr::MessagingClient::RpcSyncDelegator
- Inherits:
-
Object
- Object
- Dcmgr::MessagingClient::RpcSyncDelegator
- Defined in:
- lib/dcmgr/messaging_client.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
Instance Method Summary collapse
-
#initialize(rpc, endpoint, opts = {}) ⇒ RpcSyncDelegator
constructor
A new instance of RpcSyncDelegator.
Constructor Details
#initialize(rpc, endpoint, opts = {}) ⇒ RpcSyncDelegator
Returns a new instance of RpcSyncDelegator.
72 73 74 75 76 |
# File 'lib/dcmgr/messaging_client.rb', line 72 def initialize(rpc, endpoint, opts={}) @rpc = rpc @endpoint = endpoint @opts = {:timeout=>0.0, :oneshot=>false}.merge(opts) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object (private)
79 80 81 82 83 84 85 |
# File 'lib/dcmgr/messaging_client.rb', line 79 def method_missing(m, *args) if @opts[:oneshot] oneshot_request(m, *args) else normal_request(m, *args) end end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
70 71 72 |
# File 'lib/dcmgr/messaging_client.rb', line 70 def endpoint @endpoint end |