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.
335 336 337 338 |
# File 'lib/openc3/io/json_rpc.rb', line 335 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
349 350 351 |
# File 'lib/openc3/io/json_rpc.rb', line 349 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.
341 342 343 |
# File 'lib/openc3/io/json_rpc.rb', line 341 def result @hash['result'.freeze] end |