Class: XKoon::Proxy::Base
- Inherits:
-
Object
- Object
- XKoon::Proxy::Base
- Defined in:
- lib/xkoon/proxy.rb
Overview
Object Proxy Base Class: Inherit this class to build proxy objects, routing all method calls to the remote peer.
Instance Method Summary collapse
-
#initialize(peer, handler = XKoon::Handler) ⇒ Base
constructor
Construct: Creates a new Base proxy object around a given peer and optional handler.
-
#method_missing(name, *args) ⇒ Object
Method Missing: Proxy all method calls into requests to the remote peer.
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
Method Missing: Proxy all method calls into requests to the remote peer.
59 60 61 62 63 64 65 66 |
# File 'lib/xkoon/proxy.rb', line 59 def method_missing name, *args # Ensure we have at least a message raise "Missing argument in call to [#{name}] (msg)" unless args.size >= 1 # Forward request through Proxy Module Proxy.send name, @proxy_peer, @proxy_handler, *args end |