Exception: Yooda::APIError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, reason, response) ⇒ APIError

Returns a new instance of APIError.



8
9
10
11
12
# File 'lib/yooda/api_error.rb', line 8

def initialize(status, reason, response)
  @status = status
  @reason = reason
  @response = response
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



5
6
7
# File 'lib/yooda/api_error.rb', line 5

def reason
  @reason
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#messageObject Also known as: to_s



14
15
16
# File 'lib/yooda/api_error.rb', line 14

def message
  "#{@reason}: #{@response} (#{@status})"
end