Class: Hessian2::Client
- Inherits:
-
Object
- Object
- Hessian2::Client
- Defined in:
- lib/hessian2/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(url, proxy = {}) ⇒ Client
constructor
A new instance of Client.
- #method_missing(id, *args) ⇒ Object
Constructor Details
#initialize(url, proxy = {}) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 |
# File 'lib/hessian2/client.rb', line 15 def initialize(url, proxy = {}) uri = URI.parse(url) @scheme, @host, @port, @path = uri.scheme, uri.host, uri.port, uri.path raise "Unsupported Hessian protocol: #{@scheme}" unless %w(http https).include?(@scheme) @proxy = proxy end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(id, *args) ⇒ Object
22 23 24 |
# File 'lib/hessian2/client.rb', line 22 def method_missing(id, *args) return invoke(id.id2name, args) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
13 14 15 |
# File 'lib/hessian2/client.rb', line 13 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
12 13 14 |
# File 'lib/hessian2/client.rb', line 12 def password @password end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/hessian2/client.rb', line 13 def path @path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
13 14 15 |
# File 'lib/hessian2/client.rb', line 13 def port @port end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
13 14 15 |
# File 'lib/hessian2/client.rb', line 13 def proxy @proxy end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
13 14 15 |
# File 'lib/hessian2/client.rb', line 13 def scheme @scheme end |
#user ⇒ Object
Returns the value of attribute user.
12 13 14 |
# File 'lib/hessian2/client.rb', line 12 def user @user end |