Exception: CityGridExceptions::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/citygrid/citygrid_exceptions.rb

Overview

Define parent error classes All errors thrown in the API should extend APIError - Level 1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, response, msg = "An API error occurred", curl = nil) ⇒ APIError

Returns a new instance of APIError.



8
9
10
11
12
13
# File 'lib/citygrid/citygrid_exceptions.rb', line 8

def initialize request, response, msg = "An API error occurred", curl=nil
  @request = request
  @response = response
  @curl = curl
  super msg
end

Instance Attribute Details

#curlObject

Returns the value of attribute curl.



6
7
8
# File 'lib/citygrid/citygrid_exceptions.rb', line 6

def curl
  @curl
end

#requestObject

Returns the value of attribute request.



6
7
8
# File 'lib/citygrid/citygrid_exceptions.rb', line 6

def request
  @request
end

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/citygrid/citygrid_exceptions.rb', line 6

def response
  @response
end