edmunds_api 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.simplecov +3 -0
- data/Gemfile +5 -1
- data/README.md +10 -0
- data/endpoints.md +116 -0
- data/lib/edmunds/request.rb +6 -2
- data/lib/edmunds/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9408b1370e1ff7259d523e619c94bcdce32a88f
|
4
|
+
data.tar.gz: 97635e960f4fae48a63b47f3dc087a6d93e96a1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb58dc20557ddfc3b59fffc0c802890130ad08eb1a484bb7c3801f5f6c3b5bde15a75f7c73ef27adbe1063947919eddb1d38939b761ce37481be4aa8556fdb1
|
7
|
+
data.tar.gz: 7fca00f71ddbaf3e26b93e893f1831c01cb86b25277bfe0348a7972391855096fc141b20481f31be01aa15a30a2e2942af8d7e28174afa9731cbe211db7765bb
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: jiOAN8YTWc1vAphD3slALGYNPhnkJ981n
|
data/.simplecov
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
[![Circle CI](https://circleci.com/gh/webstreak/edmunds-api-ruby.svg?style=shield)](https://circleci.com/gh/webstreak/edmunds-api-ruby)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/webstreak/edmunds-api-ruby/badges/gpa.svg)](https://codeclimate.com/github/webstreak/edmunds-api-ruby)
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/github/webstreak/edmunds-api-ruby/badge.svg)](https://coveralls.io/github/webstreak/edmunds-api-ruby)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/edmunds_api.svg)](https://badge.fury.io/rb/edmunds_api)
|
5
|
+
[![RubyGems](http://img.shields.io/gem/dt/edmunds_api.svg?style=flat)](http://rubygems.org/gems/edmunds_api)
|
6
|
+
|
1
7
|
Edmunds Api ruby client.
|
2
8
|
|
3
9
|
> *Status*: Beta. We are preparing the project for public release soon
|
@@ -36,6 +42,10 @@ You can also pass options to an Api endpoint:
|
|
36
42
|
vehicles_api = Edmunds::Api.new.vehicles
|
37
43
|
vehicles_api.make('Lexus', {state: 'new'})
|
38
44
|
```
|
45
|
+
See supported options for each Api endpoint on [Edmunds website](http://developer.edmunds.com/api-documentation/overview/)
|
46
|
+
|
47
|
+
## Supported endpoints
|
48
|
+
[Endpoints](endpoints.md)
|
39
49
|
|
40
50
|
## Contributing
|
41
51
|
|
data/endpoints.md
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
## Vehicle API
|
2
|
+
|
3
|
+
### Makes
|
4
|
+
[Makes EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_make/v2/)
|
5
|
+
|
6
|
+
| Endpoint | Description |
|
7
|
+
|-----------|-------------|
|
8
|
+
| `Edmunds::Api.new.vehicle.makes.count(options)` | Total Count of Car Makes |
|
9
|
+
| `Edmunds::Api.new.vehicle.makes.all_makes(options)` | A List of Car Makes |
|
10
|
+
| `Edmunds::Api.new.vehicle.makes.make("Make", options)` | Details on a Specific Car Make |
|
11
|
+
|
12
|
+
### Models
|
13
|
+
[Models EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_model/v2/)
|
14
|
+
|
15
|
+
| Endpoint | Description |
|
16
|
+
|-----------|-------------|
|
17
|
+
| `Edmunds::Api.new.vehicle.models.count("Make", options)` | Total Count of Models for a Car Make |
|
18
|
+
| `Edmunds::Api.new.vehicle.models.models("Make", options)` | Get a List of Car Models for a Specific Car Make |
|
19
|
+
| `Edmunds::Api.new.vehicle.models.model("Make", "Model", options)` | Get Details on a Specific Car Model |
|
20
|
+
|
21
|
+
### Styles
|
22
|
+
[Styles EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_style/v2/)
|
23
|
+
|
24
|
+
| Endpoint | Description |
|
25
|
+
|-----------|-------------|
|
26
|
+
| `Edmunds::Api.new.vehicle.styles.count(options)` | Styles Count |
|
27
|
+
| `Edmunds::Api.new.vehicle.styles.make_count("Make", options)` | Style Count by Car Make |
|
28
|
+
| `Edmunds::Api.new.vehicle.styles.make_model_count("Make", "Model", options)` | Style Count by Car Make and Model |
|
29
|
+
| `Edmunds::Api.new.vehicle.styles.make_model_year_count("Make", "Model", "Year", options)` | Style Count by Car Make/Model/Year |
|
30
|
+
| `Edmunds::Api.new.vehicle.styles.id(style_id, options)` | Car Style Details by Car Style ID |
|
31
|
+
| `Edmunds::Api.new.vehicle.styles.make_model_year("Make", "Model", "Year", options)` | Car Style Details by Car Make/Model/Year |
|
32
|
+
| `Edmunds::Api.new.vehicle.styles.chrome_data(chrome_id, options)` | Car Style Details by Car Chrome Data ID |
|
33
|
+
|
34
|
+
### Engines
|
35
|
+
[Engines EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_engine_and_transmission/v2/)
|
36
|
+
|
37
|
+
| Endpoint | Description |
|
38
|
+
|-----------|-------------|
|
39
|
+
| `Edmunds::Api.new.vehicle.engines.details(engine_id)` | Engine Details by ID |
|
40
|
+
| `Edmunds::Api.new.vehicle.engines.by_style_id(style_id, options)` | Engines for a Car Style |
|
41
|
+
|
42
|
+
### Transmissions
|
43
|
+
[Transmissions EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_engine_and_transmission/v2/)
|
44
|
+
|
45
|
+
| Endpoint | Description |
|
46
|
+
|-----------|-------------|
|
47
|
+
| `Edmunds::Api.new.vehicle.transmissions.details(transmission_id)` | Transmission Details by ID |
|
48
|
+
| `Edmunds::Api.new.vehicle.transmissions.by_style_id(style_id, options)` | Transmissions for a Car Style |
|
49
|
+
|
50
|
+
### Colors
|
51
|
+
[Colors EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_colors_and_options/v2/)
|
52
|
+
|
53
|
+
| Endpoint | Description |
|
54
|
+
|-----------|-------------|
|
55
|
+
| `Edmunds::Api.new.vehicle.colors.details(color_id)` | Color Details by ID |
|
56
|
+
| `Edmunds::Api.new.vehicle.colors.by_style_id(style_id, options)` | Colors for a Car Style |
|
57
|
+
|
58
|
+
### Options
|
59
|
+
[Options EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_colors_and_options/v2/)
|
60
|
+
|
61
|
+
| Endpoint | Description |
|
62
|
+
|-----------|-------------|
|
63
|
+
| `Edmunds::Api.new.vehicle.options.details(option_id)` | Option Details by ID |
|
64
|
+
| `Edmunds::Api.new.vehicle.options.by_style_id(style_id, options)` | Options for a Car Style |
|
65
|
+
|
66
|
+
### Equipment
|
67
|
+
[Equipment EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_equipment/v2/)
|
68
|
+
|
69
|
+
| Endpoint | Description |
|
70
|
+
|-----------|-------------|
|
71
|
+
| `Edmunds::Api.new.vehicle.equipment.details(equipment_id)` | Equipment Details by ID |
|
72
|
+
| `Edmunds::Api.new.vehicle.equipment.by_style_id(style_id, options)` | Equipment for a Car Style |
|
73
|
+
|
74
|
+
### Squish vin
|
75
|
+
[Squish vin EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_squishvin/v2/)
|
76
|
+
|
77
|
+
| Endpoint | Description |
|
78
|
+
|-----------|-------------|
|
79
|
+
| `Edmunds::Api.new.vehicle.squishvins.decode(VIN)` | Vehicle Details by Squish VIN |
|
80
|
+
|
81
|
+
### VIN Decoding
|
82
|
+
[VIN decoding EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/spec_vin_decoding/v2/)
|
83
|
+
|
84
|
+
| Endpoint | Description |
|
85
|
+
|-----------|-------------|
|
86
|
+
| `Edmunds::Api.new.vehicle.vin.decode(VIN, options)` | Vehicle Details by VIN |
|
87
|
+
|
88
|
+
### Safety
|
89
|
+
[Safety EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/service_safety/v2/)
|
90
|
+
|
91
|
+
| Endpoint | Description |
|
92
|
+
|-----------|-------------|
|
93
|
+
| `Edmunds::Api.new.vehicle.safety.ratings(style_id)` | Safety ratings by Style ID |
|
94
|
+
| `Edmunds::Api.new.vehicle.safety.ratings("Make", "Model", "Year")` | Safety ratings by Make/Model/Year |
|
95
|
+
|
96
|
+
### Letter Grade Rating
|
97
|
+
[Grades rating EdmundsApi docs](http://developer.edmunds.com/api-documentation/vehicle/content_letter_grade/v2/)
|
98
|
+
|
99
|
+
| Endpoint | Description |
|
100
|
+
|-----------|-------------|
|
101
|
+
| `Edmunds::Api.new.vehicle.grades.by_style_id(style_id)` | Rating Details by Style ID |
|
102
|
+
| `Edmunds::Api.new.vehicle.grades.details("Make", "Model", "Year")` | All Rating Details Reviews by Make/Model/Year |
|
103
|
+
| `Edmunds::Api.new.vehicle.grades.rating("Make", "Model", "Year")` | Letter Grade Rating by Make/Model/Year |
|
104
|
+
| `Edmunds::Api.new.vehicle.grades.by_review_id("Make", "Model", "Year", review_id)` | Rating Details by Make/Model/Year and Review ID |
|
105
|
+
|
106
|
+
## Media API
|
107
|
+
|
108
|
+
### Photos
|
109
|
+
[Photos EdmundsApi docs](http://developer.edmunds.com/api-documentation/media/photos/v2/)
|
110
|
+
|
111
|
+
| Endpoint | Description |
|
112
|
+
|-----------|-------------|
|
113
|
+
| `Edmunds::Api.new.media.photos.by_year_make_model("Year", "Make", "Model", options)` | Find photos by Make/Model/Year |
|
114
|
+
| `Edmunds::Api.new.media.photos.by_tag(tag, options)` | Find photos by Tag |
|
115
|
+
| `Edmunds::Api.new.media.photos.by_style_id(style_id, options)` | Find photos by Style ID |
|
116
|
+
| `Edmunds::Api.new.media.photos.by_make_model("Make", "Model", options)` | Find photos by Make/Model |
|
data/lib/edmunds/request.rb
CHANGED
@@ -2,22 +2,26 @@ module Edmunds
|
|
2
2
|
module Request
|
3
3
|
|
4
4
|
API_URL = 'https://api.edmunds.com/api'
|
5
|
+
API_VERSION = Edmunds.configuration.api_version.to_s
|
5
6
|
|
6
7
|
def api_call(api_path, path, options={})
|
7
8
|
url = build_api_url api_path, path
|
8
9
|
request_params = merge_required_params options
|
10
|
+
raise 'No api_key found' if request_params[:api_key].empty?
|
9
11
|
response = HTTP.headers(http_headers).get(url, params: request_params)
|
10
12
|
parse_response response
|
11
13
|
end
|
12
14
|
|
15
|
+
private
|
16
|
+
|
13
17
|
def build_api_url(api_path, path)
|
14
|
-
api_version = 'v' +
|
18
|
+
api_version = 'v' + API_VERSION
|
15
19
|
API_URL + '/' + api_path + '/' + api_version + path
|
16
20
|
end
|
17
21
|
|
18
22
|
def merge_required_params(options)
|
19
23
|
{
|
20
|
-
api_key: Edmunds.configuration.api_key,
|
24
|
+
api_key: Edmunds.configuration.api_key.to_s.strip,
|
21
25
|
fmt: Edmunds.configuration.request_params.fmt
|
22
26
|
}.merge(options)
|
23
27
|
end
|
data/lib/edmunds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edmunds_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Belyaev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -101,8 +101,10 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".coveralls.yml"
|
104
105
|
- ".gitignore"
|
105
106
|
- ".rspec"
|
107
|
+
- ".simplecov"
|
106
108
|
- Gemfile
|
107
109
|
- LICENSE.txt
|
108
110
|
- README.md
|
@@ -110,6 +112,7 @@ files:
|
|
110
112
|
- bin/console
|
111
113
|
- bin/setup
|
112
114
|
- edmunds_api.gemspec
|
115
|
+
- endpoints.md
|
113
116
|
- lib/edmunds/api.rb
|
114
117
|
- lib/edmunds/configuration.rb
|
115
118
|
- lib/edmunds/error.rb
|
@@ -151,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
154
|
version: '0'
|
152
155
|
requirements: []
|
153
156
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.6.10
|
155
158
|
signing_key:
|
156
159
|
specification_version: 4
|
157
160
|
summary: Edmunds Api ruby client
|