Class: Raiblocks::Client
- Inherits:
-
Object
- Object
- Raiblocks::Client
- Defined in:
- lib/raiblocks/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.
13 14 15 16 |
# File 'lib/raiblocks/client.rb', line 13 def initialize(host: 'localhost', port: 7076) @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
11 12 13 |
# File 'lib/raiblocks/client.rb', line 11 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
11 12 13 |
# File 'lib/raiblocks/client.rb', line 11 def port @port end |
Instance Method Details
#call(action, params = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/raiblocks/client.rb', line 18 def call(action, params = {}) args = { action: action } args.merge!(params) if params.is_a?(Hash) post(args) end |