Class: JsonRpcClient
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#default_timeout ⇒ Object
readonly
Returns the value of attribute default_timeout.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #execute(params, config = RequestConfig.new(timeout: default_timeout)) ⇒ Object
-
#initialize(base_url, path, default_timeout = 1000) ⇒ JsonRpcClient
constructor
A new instance of JsonRpcClient.
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_url ⇒ Object (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_timeout ⇒ Object (readonly)
Returns the value of attribute default_timeout.
14 15 16 |
# File 'lib/calimero/jsonrpc.rb', line 14 def default_timeout @default_timeout end |
#path ⇒ Object (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 |