Class: Hprose::Client::Proxy
- Inherits:
-
Object
- Object
- Hprose::Client::Proxy
- Defined in:
- lib/hprose/client.rb
Instance Method Summary collapse
- #[](namespace) ⇒ Object
-
#initialize(client, namespace = nil) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(methodname, *args, &block) ⇒ Object
Constructor Details
#initialize(client, namespace = nil) ⇒ Proxy
Returns a new instance of Proxy.
182 183 184 185 |
# File 'lib/hprose/client.rb', line 182 def initialize(client, namespace = nil) @client = client @namespace = namespace end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(methodname, *args, &block) ⇒ Object
189 190 191 192 |
# File 'lib/hprose/client.rb', line 189 def method_missing(methodname, *args, &block) methodname = @namespace.to_s + '_' + methodname.to_s unless @namespace.nil? @client.invoke(methodname, args, &block) end |