Class: Electrb::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/electrb/client.rb', line 7

def initialize(host, port)
  @client = Jsonrpctcp::Client.new(host, port)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/electrb/client.rb', line 5

def client
  @client
end

Instance Method Details

#request(method_name, *args) ⇒ String

Send RPC request.

Parameters:

  • method_name (String)

    Method name to be called by RPC.

Returns:

  • (String)

    RPC result.



14
15
16
# File 'lib/electrb/client.rb', line 14

def request(method_name, *args)
  send_request(method_name, *args)
end