Exception: Footrest::HttpError::ErrorBase

Inherits:
StandardError
  • Object
show all
Defined in:
lib/footrest/http_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ ErrorBase



7
8
9
10
11
12
13
14
# File 'lib/footrest/http_error.rb', line 7

def initialize(response=nil)
  @response = response
  @status = @response[:status]
  @body = @response[:body]
  @method = @response[:method]

  super("HTTP ERROR: #{@status}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/footrest/http_error.rb', line 5

def body
  @body
end

#methodObject (readonly)

Returns the value of attribute method.



5
6
7
# File 'lib/footrest/http_error.rb', line 5

def method
  @method
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/footrest/http_error.rb', line 5

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/footrest/http_error.rb', line 5

def status
  @status
end