Exception: TimeDoctor::TimeDoctorError
- Inherits:
-
StandardError
- Object
- StandardError
- TimeDoctor::TimeDoctorError
- Defined in:
- lib/timedoctor/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(response) ⇒ TimeDoctorError
constructor
A new instance of TimeDoctorError.
Constructor Details
#initialize(response) ⇒ TimeDoctorError
Returns a new instance of TimeDoctorError.
3 4 5 6 7 |
# File 'lib/timedoctor/exceptions.rb', line 3 def initialize(response) @code = response.status @body = JSON.parse(response.body) = end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/timedoctor/exceptions.rb', line 9 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/timedoctor/exceptions.rb', line 9 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
9 10 11 |
# File 'lib/timedoctor/exceptions.rb', line 9 def end |