Class: OpenC3::JsonRpcErrorResponse
- Inherits:
-
JsonRpcResponse
- Object
- JsonRpc
- JsonRpcResponse
- OpenC3::JsonRpcErrorResponse
- Defined in:
- lib/openc3/io/json_rpc.rb
Overview
Represents a JSON Remote Procedure Call Error Response
Class Method Summary collapse
-
.from_hash(hash) ⇒ JsonRpcErrorResponse
Creates a JsonRpcErrorResponse object from a Hash.
Instance Method Summary collapse
-
#error ⇒ JsonRpcError
The error object.
-
#initialize(error, id) ⇒ JsonRpcErrorResponse
constructor
A new instance of JsonRpcErrorResponse.
Methods inherited from JsonRpcResponse
Methods inherited from JsonRpc
Constructor Details
#initialize(error, id) ⇒ JsonRpcErrorResponse
Returns a new instance of JsonRpcErrorResponse.
359 360 361 362 |
# File 'lib/openc3/io/json_rpc.rb', line 359 def initialize(error, id) super(id) @hash['error'.freeze] = error end |
Class Method Details
.from_hash(hash) ⇒ JsonRpcErrorResponse
Creates a JsonRpcErrorResponse object from a Hash
373 374 375 |
# File 'lib/openc3/io/json_rpc.rb', line 373 def self.from_hash(hash) self.new(JsonRpcError.from_hash(hash['error'.freeze]), hash['id'.freeze]) end |
Instance Method Details
#error ⇒ JsonRpcError
Returns The error object.
365 366 367 |
# File 'lib/openc3/io/json_rpc.rb', line 365 def error @hash['error'.freeze] end |