Class: OpenC3::JsonRpcSuccessResponse
- Inherits:
-
JsonRpcResponse
- Object
- JsonRpc
- JsonRpcResponse
- OpenC3::JsonRpcSuccessResponse
- Defined in:
- lib/openc3/io/json_rpc.rb
Overview
Represents a JSON Remote Procedure Call Success Response
Class Method Summary collapse
-
.from_hash(hash) ⇒ JsonRpcSuccessResponse
Creates a JsonRpcSuccessResponse object from a Hash.
Instance Method Summary collapse
-
#initialize(result, id) ⇒ JsonRpcSuccessResponse
constructor
A new instance of JsonRpcSuccessResponse.
-
#result ⇒ Object
The result of the method request.
Methods inherited from JsonRpcResponse
Methods inherited from JsonRpc
Constructor Details
#initialize(result, id) ⇒ JsonRpcSuccessResponse
Returns a new instance of JsonRpcSuccessResponse.
336 337 338 339 |
# File 'lib/openc3/io/json_rpc.rb', line 336 def initialize(result, id) super(id) @hash['result'.freeze] = result end |
Class Method Details
.from_hash(hash) ⇒ JsonRpcSuccessResponse
Creates a JsonRpcSuccessResponse object from a Hash
350 351 352 |
# File 'lib/openc3/io/json_rpc.rb', line 350 def self.from_hash(hash) self.new(hash['result'.freeze], hash['id'.freeze]) end |
Instance Method Details
#result ⇒ Object
Returns The result of the method request.
342 343 344 |
# File 'lib/openc3/io/json_rpc.rb', line 342 def result @hash['result'.freeze] end |