edmunds 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b10f197a1f97da84bc7b0c17dfcb873e4901a0f7
4
- data.tar.gz: dce665b4d085c519b8c755bad6dd654249d34f7d
3
+ metadata.gz: 5887f5db25ae3dc4e3a2908057a3f458fb60cc2c
4
+ data.tar.gz: e7771bc24c5c8a050c81577e3dbd1ad7b69b142e
5
5
  SHA512:
6
- metadata.gz: 00b645bc9b04f85a6b150ae1308385a9d15bcbbc62358777e1ee6863e5f2cc8df43dbe4209864141ff627f855e4f1243734cbd422d33c7421dcdcc0ecda9a05a
7
- data.tar.gz: 6dc8df302834aebca1fae07f01f2940743e48647eb01144c46e8d78c625e9307d3cbb51ada090189d9ea260f71e1263f3f6cf149c4e23643e1db428e4e293bae
6
+ metadata.gz: 999385f24d54242fe4b4c42555163b072bfcb3373dd79fdbdac0d2801e03ee3a0f52342c796d3aba6883c54dc11670c8047619895bef8d777cc77a62714630a9
7
+ data.tar.gz: 5951e4b3a6b75b793508bee772dd4dc6d9a0052d2847a9b966553d31dbb09b5a5305be3cbf2d492972b14330cb974fb8a9a7317d80ea05c9dc459d452e34a63d
@@ -1,5 +1,3 @@
1
- require 'edmunds'
2
-
3
1
  module Edmunds
4
2
  module Vehicle
5
3
  # Static Vehicle API data
@@ -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
- attr_reader :id, :name, :years
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("#{MODEL_API_URL}/#{make_name}/#{model_name}/#{model_year}") do |request|
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("#{MODEL_API_URL}/#{make_name}/#{model_name}/years") do |request|
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("#{MODEL_API_URL}/#{make_name}/#{model_name}/years/count") do |request|
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
@@ -1,3 +1,3 @@
1
1
  module Edmunds
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
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.7
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: 2015-11-12 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler