Class: JsonRpcClient

Inherits:
RpcClient show all
Defined in:
lib/calimero/jsonrpc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, path, default_timeout = 1000) ⇒ JsonRpcClient

Returns a new instance of JsonRpcClient.



16
17
18
19
20
# File 'lib/calimero/jsonrpc.rb', line 16

def initialize(base_url, path, default_timeout = 1000)
  @base_url = base_url
  @path = path
  @default_timeout = default_timeout
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



14
15
16
# File 'lib/calimero/jsonrpc.rb', line 14

def base_url
  @base_url
end

#default_timeoutObject (readonly)

Returns the value of attribute default_timeout.



14
15
16
# File 'lib/calimero/jsonrpc.rb', line 14

def default_timeout
  @default_timeout
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'lib/calimero/jsonrpc.rb', line 14

def path
  @path
end

Instance Method Details

#execute(params, config = RequestConfig.new(timeout: default_timeout)) ⇒ Object



22
23
24
# File 'lib/calimero/jsonrpc.rb', line 22

def execute(params, config = RequestConfig.new(timeout: default_timeout))
  request('execute', params, config)
end