Exception: Plaza::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Plaza::Error
- Defined in:
- lib/plaza/models/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, message = nil) ⇒ Error
constructor
A new instance of Error.
- #status ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(response, message = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 |
# File 'lib/plaza/models/error.rb', line 5 def initialize(response, = nil) @response = response @message = || "Failed." @message << " Response code = #{status}." if status end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/plaza/models/error.rb', line 3 def response @response end |
Instance Method Details
#status ⇒ Object
11 12 13 |
# File 'lib/plaza/models/error.rb', line 11 def status response.respond_to?(:status) ? response.status : nil end |
#to_s ⇒ Object Also known as: to_str
15 16 17 |
# File 'lib/plaza/models/error.rb', line 15 def to_s @message end |