Exception: RallyUp::Error
- Inherits:
-
StandardError
- Object
- StandardError
- RallyUp::Error
- Defined in:
- lib/rally_up.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
56 57 58 59 60 |
# File 'lib/rally_up.rb', line 56 def initialize(response) @body = response.body @code = response.code super end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
54 55 56 |
# File 'lib/rally_up.rb', line 54 def body @body end |
#code ⇒ Object
Returns the value of attribute code.
54 55 56 |
# File 'lib/rally_up.rb', line 54 def code @code end |
Instance Method Details
#as_json ⇒ Object
66 67 68 |
# File 'lib/rally_up.rb', line 66 def as_json { error: to_s } end |
#message ⇒ Object
62 63 64 |
# File 'lib/rally_up.rb', line 62 def "#{code} #{body}" end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/rally_up.rb', line 70 def to_s "#{self.class}: #{}" end |