edmunds 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/edmunds/vehicle.rb +0 -2
- data/lib/edmunds/vehicle/specification/color.rb +3 -3
- data/lib/edmunds/vehicle/specification/make.rb +7 -5
- data/lib/edmunds/vehicle/specification/model.rb +6 -3
- data/lib/edmunds/vehicle/specification/model_year.rb +6 -5
- data/lib/edmunds/vehicle/specification/option.rb +3 -3
- data/lib/edmunds/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5887f5db25ae3dc4e3a2908057a3f458fb60cc2c
|
4
|
+
data.tar.gz: e7771bc24c5c8a050c81577e3dbd1ad7b69b142e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 999385f24d54242fe4b4c42555163b072bfcb3373dd79fdbdac0d2801e03ee3a0f52342c796d3aba6883c54dc11670c8047619895bef8d777cc77a62714630a9
|
7
|
+
data.tar.gz: 5951e4b3a6b75b793508bee772dd4dc6d9a0052d2847a9b966553d31dbb09b5a5305be3cbf2d492972b14330cb974fb8a9a7317d80ea05c9dc459d452e34a63d
|
data/lib/edmunds/vehicle.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
STYLE_API_URL = Edmunds::Vehicle::API_URL_V2 + '/styles'
|
5
|
-
COLORS_API_URL = Edmunds::Vehicle::API_URL_V2 + '/colors'
|
6
|
-
|
7
4
|
module Edmunds
|
8
5
|
module Vehicle
|
9
6
|
module Specification
|
10
7
|
module Color
|
8
|
+
|
9
|
+
STYLE_API_URL = Edmunds::Vehicle::API_URL_V2 + '/styles'
|
10
|
+
COLORS_API_URL = Edmunds::Vehicle::API_URL_V2 + '/colors'
|
11
11
|
|
12
12
|
class ColorsByStyle
|
13
13
|
attr_reader :colors, :count
|
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
MAKE_API_URL = Edmunds::Vehicle::API_URL_V2
|
5
|
-
MAKES_API_URL = MAKE_API_URL + '/makes'
|
6
|
-
MAKES_COUNT_API_URL = MAKES_API_URL + '/count'
|
7
|
-
|
8
4
|
module Edmunds
|
9
5
|
module Vehicle
|
10
6
|
module Specification
|
11
7
|
module Make
|
8
|
+
|
9
|
+
MAKE_API_URL = Edmunds::Vehicle::API_URL_V2
|
10
|
+
MAKES_API_URL = MAKE_API_URL + '/makes'
|
11
|
+
MAKES_COUNT_API_URL = MAKES_API_URL + '/count'
|
12
|
+
|
12
13
|
class Makes
|
13
14
|
attr_reader :makes
|
14
15
|
|
@@ -38,11 +39,12 @@ module Edmunds
|
|
38
39
|
end
|
39
40
|
|
40
41
|
class Make
|
41
|
-
attr_reader :id, :name, :models
|
42
|
+
attr_reader :id, :name, :nice_name, :models
|
42
43
|
|
43
44
|
def initialize(attributes)
|
44
45
|
@id = attributes['id']
|
45
46
|
@name = attributes['name']
|
47
|
+
@nice_name = attributes['niceName']
|
46
48
|
@models = attributes['models'].map { |json| Edmunds::Vehicle::Specification::Model::Model.new(json) } if attributes.key?('models')
|
47
49
|
end
|
48
50
|
|
@@ -1,18 +1,21 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
MODEL_API_URL = Edmunds::Vehicle::API_URL_V2
|
5
|
-
|
6
4
|
module Edmunds
|
7
5
|
module Vehicle
|
8
6
|
module Specification
|
9
7
|
module Model
|
8
|
+
|
9
|
+
MODEL_API_URL = Edmunds::Vehicle::API_URL_V2
|
10
|
+
|
10
11
|
class Model
|
11
|
-
|
12
|
+
|
13
|
+
attr_reader :id, :name, :nice_name, :years
|
12
14
|
|
13
15
|
def initialize(attributes)
|
14
16
|
@id = attributes['id']
|
15
17
|
@name = attributes['name']
|
18
|
+
@nice_name = attributes['niceName']
|
16
19
|
@years = attributes['years'].map { |json| Edmunds::Vehicle::Specification::ModelYear::ModelYear.new(json) } if attributes.key?('years')
|
17
20
|
end
|
18
21
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
MODEL_YEAR_API_URL = Edmunds::Vehicle::API_URL_V2
|
5
|
-
|
6
4
|
module Edmunds
|
7
5
|
module Vehicle
|
8
6
|
module Specification
|
9
7
|
module ModelYear
|
8
|
+
|
9
|
+
MODEL_YEAR_API_URL = Edmunds::Vehicle::API_URL_V2
|
10
|
+
|
10
11
|
class ModelYear
|
11
12
|
attr_reader :id, :year, :styles
|
12
13
|
|
@@ -17,7 +18,7 @@ module Edmunds
|
|
17
18
|
end
|
18
19
|
|
19
20
|
def self.find(make_name, model_name, model_year, api_params = {})
|
20
|
-
response = Edmunds::Api.get("#{
|
21
|
+
response = Edmunds::Api.get("#{MODEL_YEAR_API_URL}/#{make_name}/#{model_name}/#{model_year}") do |request|
|
21
22
|
request.raw_parameters = api_params
|
22
23
|
|
23
24
|
request.allowed_parameters = {
|
@@ -48,7 +49,7 @@ module Edmunds
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def self.find(make_name, model_name, api_params = {})
|
51
|
-
response = Edmunds::Api.get("#{
|
52
|
+
response = Edmunds::Api.get("#{MODEL_YEAR_API_URL}/#{make_name}/#{model_name}/years") do |request|
|
52
53
|
request.raw_parameters = api_params
|
53
54
|
|
54
55
|
request.allowed_parameters = {
|
@@ -78,7 +79,7 @@ module Edmunds
|
|
78
79
|
end
|
79
80
|
|
80
81
|
def self.find(make_name, model_name, api_params = {})
|
81
|
-
response = Edmunds::Api.get("#{
|
82
|
+
response = Edmunds::Api.get("#{MODEL_YEAR_API_URL}/#{make_name}/#{model_name}/years/count") do |request|
|
82
83
|
request.raw_parameters = api_params
|
83
84
|
|
84
85
|
request.allowed_parameters = {
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
STYLE_API_URL = Edmunds::Vehicle::API_URL_V2 + '/styles'
|
5
|
-
OPTIONS_API_URL = Edmunds::Vehicle::API_URL_V2 + '/options'
|
6
|
-
|
7
4
|
module Edmunds
|
8
5
|
module Vehicle
|
9
6
|
module Specification
|
10
7
|
module Option
|
11
8
|
|
9
|
+
STYLE_API_URL = Edmunds::Vehicle::API_URL_V2 + '/styles'
|
10
|
+
OPTIONS_API_URL = Edmunds::Vehicle::API_URL_V2 + '/options'
|
11
|
+
|
12
12
|
class OptionsByStyle
|
13
13
|
attr_reader :options,
|
14
14
|
:count
|
data/lib/edmunds/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edmunds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Parraga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|