Class: Hessian2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/hessian2/client.rb

Direct Known Subclasses

HessianClient

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hostObject (readonly)

Returns the value of attribute host.



13
14
15
# File 'lib/hessian2/client.rb', line 13

def host
  @host
end

#passwordObject

Returns the value of attribute password.



12
13
14
# File 'lib/hessian2/client.rb', line 12

def password
  @password
end

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/hessian2/client.rb', line 13

def path
  @path
end

#portObject (readonly)

Returns the value of attribute port.



13
14
15
# File 'lib/hessian2/client.rb', line 13

def port
  @port
end

#proxyObject (readonly)

Returns the value of attribute proxy.



13
14
15
# File 'lib/hessian2/client.rb', line 13

def proxy
  @proxy
end

#schemeObject (readonly)

Returns the value of attribute scheme.



13
14
15
# File 'lib/hessian2/client.rb', line 13

def scheme
  @scheme
end

#userObject

Returns the value of attribute user.



12
13
14
# File 'lib/hessian2/client.rb', line 12

def user
  @user
end