Exception: Restfulness::HTTPException
- Inherits:
-
StandardError
- Object
- StandardError
- Restfulness::HTTPException
- Defined in:
- lib/restfulness/exceptions.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, payload = "", opts = {}) ⇒ HTTPException
constructor
A new instance of HTTPException.
Constructor Details
#initialize(status, payload = "", opts = {}) ⇒ HTTPException
Returns a new instance of HTTPException.
8 9 10 11 12 13 |
# File 'lib/restfulness/exceptions.rb', line 8 def initialize(status, payload = "", opts = {}) @status = status @payload = payload @headers = opts[:headers] || {} super(opts[:message] || STATUSES[status]) end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers
6 7 8 |
# File 'lib/restfulness/exceptions.rb', line 6 def headers @headers end |
#payload ⇒ Object
Returns the value of attribute payload
6 7 8 |
# File 'lib/restfulness/exceptions.rb', line 6 def payload @payload end |
#status ⇒ Object
Returns the value of attribute status
6 7 8 |
# File 'lib/restfulness/exceptions.rb', line 6 def status @status end |