Exception: PawClient::Client::ClientError
- Inherits:
-
StandardError
- Object
- StandardError
- PawClient::Client::ClientError
- Defined in:
- lib/paw_client/client.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(response) ⇒ ClientError
constructor
A new instance of ClientError.
- #request ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(response) ⇒ ClientError
Returns a new instance of ClientError.
11 12 13 14 15 16 |
# File 'lib/paw_client/client.rb', line 11 def initialize(response) super() @response = response =to_json.success rescue 'Error while call plugandwork API, Unparsable response' super() end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/paw_client/client.rb', line 9 def response @response end |
Instance Method Details
#info ⇒ Object
18 19 20 |
# File 'lib/paw_client/client.rb', line 18 def info to_json.info end |
#request ⇒ Object
26 27 28 |
# File 'lib/paw_client/client.rb', line 26 def request self.response.request end |
#to_json ⇒ Object
22 23 24 |
# File 'lib/paw_client/client.rb', line 22 def to_json JSON.parse(self.response.to_s) end |