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, options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
17
18
19
# File 'lib/hessian2/client.rb', line 11

def initialize(url, options = {})
  uri = URI.parse(url)
  @scheme, @host, @port, @path = uri.scheme, uri.host, uri.port, uri.path.empty? ? '/' : uri.path
  @path += "?#{uri.query}" if uri.query
  raise "Unsupported Hessian protocol: #{@scheme}" unless %w(http https).include?(@scheme)
  @async = options.delete(:async)
  @fiber_aware = options.delete(:fiber_aware)
  @proxy = options
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.



9
10
11
# File 'lib/hessian2/client.rb', line 9

def host
  @host
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/hessian2/client.rb', line 8

def password
  @password
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/hessian2/client.rb', line 9

def path
  @path
end

#portObject (readonly)

Returns the value of attribute port.



9
10
11
# File 'lib/hessian2/client.rb', line 9

def port
  @port
end

#proxyObject (readonly)

Returns the value of attribute proxy.



9
10
11
# File 'lib/hessian2/client.rb', line 9

def proxy
  @proxy
end

#schemeObject (readonly)

Returns the value of attribute scheme.



9
10
11
# File 'lib/hessian2/client.rb', line 9

def scheme
  @scheme
end

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/hessian2/client.rb', line 8

def user
  @user
end