Class: AcuityData::Client
- Inherits:
-
Object
- Object
- AcuityData::Client
- Includes:
- Constants
- Defined in:
- lib/acuitydata/client.rb
Constant Summary
Constants included from Constants
AcuityData::Constants::BASE_PATH, AcuityData::Constants::BASE_PORT, AcuityData::Constants::BASE_URI
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Class Method Summary collapse
-
.api_version ⇒ Object
This is the version of the API docs this client was built off-of.
- .compatible_api_version ⇒ Object
Instance Method Summary collapse
-
#initialize(auth_token, base_path: BASE_PATH, port: BASE_PORT) ⇒ Client
constructor
A new instance of Client.
-
#make ⇒ Object
Endpoints /lookup/make Retrieve make information.
-
#model(make, year = nil) ⇒ Object
/lookup/model/#make Retrieve model information for make.
- #report(make, model, variant, year, mileage) ⇒ Object
- #variant(make, model, year) ⇒ Object
- #year(make, model = nil) ⇒ Object
Constructor Details
Instance Attribute Details
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
5 6 7 |
# File 'lib/acuitydata/client.rb', line 5 def auth_token @auth_token end |
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
5 6 7 |
# File 'lib/acuitydata/client.rb', line 5 def base_path @base_path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/acuitydata/client.rb', line 5 def port @port end |
Class Method Details
.api_version ⇒ Object
This is the version of the API docs this client was built off-of
18 19 20 |
# File 'lib/acuitydata/client.rb', line 18 def self.api_version 'v1 2024-03-19' end |
.compatible_api_version ⇒ Object
13 14 15 |
# File 'lib/acuitydata/client.rb', line 13 def self.compatible_api_version 'v1' end |
Instance Method Details
#make ⇒ Object
Endpoints /lookup/make Retrieve make information
25 26 27 |
# File 'lib/acuitydata/client.rb', line 25 def make send_request(http_method: :get, path: "lookup/make") end |
#model(make, year = nil) ⇒ Object
/lookup/model/#make Retrieve model information for make
31 32 33 34 35 36 37 |
# File 'lib/acuitydata/client.rb', line 31 def model(make, year = nil) if year send_request(http_method: :get, path: "lookup/model2/#{make}/#{year}") else send_request(http_method: :get, path: "lookup/model/#{make}") end end |
#report(make, model, variant, year, mileage) ⇒ Object
57 58 59 |
# File 'lib/acuitydata/client.rb', line 57 def report(make, model, variant, year, mileage) send_request(http_method: :get, path: "report/#{make}/#{model}/#{variant}/#{year}/#{mileage}") end |
#variant(make, model, year) ⇒ Object
51 52 53 |
# File 'lib/acuitydata/client.rb', line 51 def variant(make, model, year) send_request(http_method: :get, path: "lookup/variant/#{make}/#{model}/#{year}") end |
#year(make, model = nil) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/acuitydata/client.rb', line 41 def year(make, model = nil) if model send_request(http_method: :get, path: "lookup/year/#{make}/#{model}") else send_request(http_method: :get, path: "lookup/year2/#{make}") end end |