Class: KodiClient::KodiResponse
- Inherits:
-
Object
- Object
- KodiClient::KodiResponse
- Includes:
- Extensions::Comparable
- Defined in:
- lib/kodi_client/kodi_response.rb
Overview
represents a kodi response
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(hash) ⇒ KodiResponse
constructor
A new instance of KodiResponse.
Methods included from Extensions::Comparable
Constructor Details
#initialize(hash) ⇒ KodiResponse
Returns a new instance of KodiResponse.
10 11 12 13 14 15 |
# File 'lib/kodi_client/kodi_response.rb', line 10 def initialize(hash) @id = hash['id'] @jsonrpc = hash['jsonrpc'] @result = hash['result'] @error = KodiError.new(hash['error']) unless hash['error'].nil? end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
8 9 10 |
# File 'lib/kodi_client/kodi_response.rb', line 8 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/kodi_client/kodi_response.rb', line 8 def id @id end |
#jsonrpc ⇒ Object (readonly)
Returns the value of attribute jsonrpc.
8 9 10 |
# File 'lib/kodi_client/kodi_response.rb', line 8 def jsonrpc @jsonrpc end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/kodi_client/kodi_response.rb', line 8 def result @result end |
Instance Method Details
#error? ⇒ Boolean
17 18 19 |
# File 'lib/kodi_client/kodi_response.rb', line 17 def error? !@error.nil? end |