Class: Nestful::ConnectionError
- Inherits:
-
Object
- Object
- Nestful::ConnectionError
- Defined in:
- lib/kazoo/connection_error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, message = nil) ⇒ ConnectionError
constructor
A new instance of ConnectionError.
- #to_s ⇒ Object
Constructor Details
#initialize(response, message = nil) ⇒ ConnectionError
Returns a new instance of ConnectionError.
5 6 7 8 9 |
# File 'lib/kazoo/connection_error.rb', line 5 def initialize(response, = nil) @body = response.body if response.respond_to?(:body) @response = response @message = end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/kazoo/connection_error.rb', line 3 def response @response end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/kazoo/connection_error.rb', line 11 def to_s = "Failed." << " Response code = #{response.code}." if response.respond_to?(:code) << " Response message = #{response.}." if response.respond_to?(:message) << " Response data = #{JSON.parse(@body)['data']}" end |