Exception: Restfulness::HTTPException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/restfulness/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/restfulness/exceptions.rb', line 6

def headers
  @headers
end

#payloadObject

Returns the value of attribute payload.



6
7
8
# File 'lib/restfulness/exceptions.rb', line 6

def payload
  @payload
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/restfulness/exceptions.rb', line 6

def status
  @status
end