Class: Aria2Driver::JsonRpc::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/aria2_driver/json_rpc/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorObject

Returns the value of attribute error.



6
7
8
# File 'lib/aria2_driver/json_rpc/response.rb', line 6

def error
  @error
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/aria2_driver/json_rpc/response.rb', line 6

def id
  @id
end

#jsonrpcObject (readonly)

Returns the value of attribute jsonrpc.



6
7
8
# File 'lib/aria2_driver/json_rpc/response.rb', line 6

def jsonrpc
  @jsonrpc
end

#resultObject

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

Returns:

  • (Boolean)


14
15
16
# File 'lib/aria2_driver/json_rpc/response.rb', line 14

def error?
  error != nil
end