Class: RaiblocksRpc::Client
- Inherits:
-
Object
- Object
- RaiblocksRpc::Client
- Defined in:
- lib/raiblocks_rpc/client.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #call(action, params = {}) ⇒ Object
-
#initialize(host: 'localhost', port: 7076) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(host: 'localhost', port: 7076) ⇒ Client
Returns a new instance of Client.
9 10 11 12 |
# File 'lib/raiblocks_rpc/client.rb', line 9 def initialize(host: 'localhost', port: 7076) @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/raiblocks_rpc/client.rb', line 7 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/raiblocks_rpc/client.rb', line 7 def port @port end |
Instance Method Details
#call(action, params = {}) ⇒ Object
14 15 16 |
# File 'lib/raiblocks_rpc/client.rb', line 14 def call(action, params = {}) post({ action: action }.merge(params)) end |