struct

JSON::RPC::Response

Inherits JSON::Serializable < Struct < Value < Object

A single JSON-RPC 2.0 response object.

Exactly one of {#result} or {#error} is present for a well-formed response. Results are exposed as JSON::Any so the caller can convert them into whatever concrete type the method is documented to return.

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

error
Source
error?

true when the response carries an error member.

Source
id

The id echoes the request id. Typed as JSON::Any? because the specification permits a string, number, or null.

Source
jsonrpc
Source
result
Source
result!

Returns the result, raising the corresponding {Error} when the response represents a failure.

Source