Class: QBittorrent::WebApi::Response
- Inherits:
-
Object
- Object
- QBittorrent::WebApi::Response
- Defined in:
- lib/qbittorrent/web_api/response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#is_success ⇒ Object
Returns the value of attribute is_success.
-
#message ⇒ Object
Returns the value of attribute message.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(is_success, response, message = nil) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(is_success, response, message = nil) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/qbittorrent/web_api/response.rb', line 6 def initialize(is_success, response, = nil) @is_success = is_success @response = response @message = @data = begin JSON.parse(response.to_s) rescue StandardError => _e response.to_s end end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/qbittorrent/web_api/response.rb', line 4 def data @data end |
#is_success ⇒ Object
Returns the value of attribute is_success.
4 5 6 |
# File 'lib/qbittorrent/web_api/response.rb', line 4 def is_success @is_success end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/qbittorrent/web_api/response.rb', line 4 def @message end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/qbittorrent/web_api/response.rb', line 4 def response @response end |
Instance Method Details
#success? ⇒ Boolean
17 18 19 |
# File 'lib/qbittorrent/web_api/response.rb', line 17 def success? is_success end |