class Barrister::RpcResponse

Represents as single JSON-RPC response. This is used by the Batch class so that responses are wrapped in a more friendly class container.

Non-batch calls don’t need this wrapper, as they receive the result directly, or have a RpcException raised.

Attributes

error[RW]

Properties exposed on the response

You can raise ‘resp.error` when you iterate through results from a batch send.

id[RW]

Properties exposed on the response

You can raise ‘resp.error` when you iterate through results from a batch send.

method[RW]

Properties exposed on the response

You can raise ‘resp.error` when you iterate through results from a batch send.

params[RW]

Properties exposed on the response

You can raise ‘resp.error` when you iterate through results from a batch send.

result[RW]

Properties exposed on the response

You can raise ‘resp.error` when you iterate through results from a batch send.

Public Class Methods

new(req, resp) click to toggle source
# File lib/barrister.rb, line 424
def initialize(req, resp)
  @id     = resp["id"]
  @result = resp["result"]
  @method = req["method"]
  @params = req["params"]

  if resp["error"]
    e = resp["error"]
    @error = RpcException.new(e["code"], e["message"], e["data"])
  end
end