Exception: Checkdin::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/checkdin/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body) ⇒ APIError

Returns a new instance of APIError.



6
7
8
9
# File 'lib/checkdin/api_error.rb', line 6

def initialize(status, body)
  @status   = status
  @body     = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/checkdin/api_error.rb', line 4

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/checkdin/api_error.rb', line 4

def status
  @status
end

Instance Method Details

#messageObject



11
12
13
# File 'lib/checkdin/api_error.rb', line 11

def message
  "Status Code: #{status}\nBody: #{body}"
end