Class: Aria2Driver::JsonRpc::Response
- Inherits:
-
Object
- Object
- Aria2Driver::JsonRpc::Response
- Defined in:
- lib/aria2_driver/json_rpc/response.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#jsonrpc ⇒ Object
readonly
Returns the value of attribute jsonrpc.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(response_hash) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response_hash) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 8 def initialize(response_hash) @jsonrpc = response_hash['jsonrpc'] @id = response_hash['id'] detect_payload(response_hash) end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
6 7 8 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 6 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 6 def id @id end |
#jsonrpc ⇒ Object (readonly)
Returns the value of attribute jsonrpc.
6 7 8 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 6 def jsonrpc @jsonrpc end |
#result ⇒ Object
Returns the value of attribute result.
6 7 8 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 6 def result @result end |
Instance Method Details
#error? ⇒ Boolean
14 15 16 |
# File 'lib/aria2_driver/json_rpc/response.rb', line 14 def error? error != nil end |