Class: Edmunds::ModelYear
- Inherits:
-
API
- Object
- API
- Edmunds::ModelYear
show all
- Defined in:
- lib/edmunds/model_year.rb
Instance Attribute Summary
Attributes inherited from API
#api_key, #base, #base_url, #format, #image_base_url
Instance Method Summary
collapse
Methods inherited from API
#call_api, #initialize, #set_key
Constructor Details
This class inherits a constructor from Edmunds::API
Instance Method Details
#find_by_id(id) ⇒ Object
4
5
6
7
8
|
# File 'lib/edmunds/model_year.rb', line 4
def find_by_id(id)
@url = "/modelyearrepository/findbyid?id=#{id}&"
call_api
@json["modelYearHolder"]
end
|
#find_distinct_year_with_new ⇒ Object
10
11
12
13
14
|
# File 'lib/edmunds/model_year.rb', line 10
def find_distinct_year_with_new
@url = "/modelyearrepository/finddistinctyearwithnew?"
call_api
@json
end
|
#find_distinct_year_with_new_or_used ⇒ Object
16
17
18
19
20
|
# File 'lib/edmunds/model_year.rb', line 16
def find_distinct_year_with_new_or_used
@url = "/modelyearrepository/finddistinctyearwithneworused?"
call_api
@json
end
|
#find_distinct_year_with_used ⇒ Object
22
23
24
25
26
|
# File 'lib/edmunds/model_year.rb', line 22
def find_distinct_year_with_used
@url = "/modelyearrepository/finddistinctyearwithused?"
call_api
@json
end
|
#find_future_model_years_by_model_id(model_id) ⇒ Object
28
29
30
31
32
|
# File 'lib/edmunds/model_year.rb', line 28
def find_future_model_years_by_model_id(model_id)
@url = "/modelyearrepository/findfuturemodelyearsbymodelid?modelId=#{model_id}&"
call_api
@json["modelYearHolder"]
end
|
#find_model_years_by_make_and_year(make, year) ⇒ Object
34
35
36
37
38
|
# File 'lib/edmunds/model_year.rb', line 34
def find_model_years_by_make_and_year(make, year)
@url = "/modelyearrepository/findmodelyearsbymakeandyear?make=#{make}&year=#{year}&"
call_api
@json["modelYearHolder"]
end
|
#find_model_years_by_make_model(make, model) ⇒ Object
40
41
42
43
44
|
# File 'lib/edmunds/model_year.rb', line 40
def find_model_years_by_make_model(make, model)
@url = "/modelyearrepository/findmodelyearsbymakemodel?make=#{make}&model=#{model}&"
call_api
@json["modelYearHolder"]
end
|
#find_new_and_used_model_years_by_makeid_and_year(make_id, year) ⇒ Object
46
47
48
49
50
|
# File 'lib/edmunds/model_year.rb', line 46
def find_new_and_used_model_years_by_makeid_and_year(make_id, year)
@url = "/modelyearrepository/findnewandusedmodelyearsbymakeidandyear?makeid=#{make_id}&year=#{year}&"
call_api
@json["modelYearHolder"]
end
|
#find_new_model_years_by_model_id(model_id) ⇒ Object
52
53
54
55
56
|
# File 'lib/edmunds/model_year.rb', line 52
def find_new_model_years_by_model_id(model_id)
@url = "/modelyearrepository/findnewmodelyearsbymodelid?modelId=#{model_id}&"
call_api
@json["modelYearHolder"]
end
|
#find_used_model_years_by_model_id(model_id) ⇒ Object
58
59
60
61
62
|
# File 'lib/edmunds/model_year.rb', line 58
def find_used_model_years_by_model_id(model_id)
@url = "/modelyearrepository/findusedmodelyearsbymodelid?modelId=#{model_id}&"
call_api
@json["modelYearHolder"]
end
|
#find_years_by_category_and_publication_state(category, state) ⇒ Object
64
65
66
67
68
|
# File 'lib/edmunds/model_year.rb', line 64
def find_years_by_category_and_publication_state(category, state)
@url = "/modelyearrepository/findyearsbycategoryandpublicationstate?category=#{category}&state=#{state}&"
call_api
@json
end
|
#for_model_id(model_id) ⇒ Object
70
71
72
73
74
|
# File 'lib/edmunds/model_year.rb', line 70
def for_model_id(model_id)
@url = "/modelyearrepository/formodelid?modelid=#{model_id}&"
call_api
@json["modelYearHolder"]
end
|
#for_year_make_model(year, make, model) ⇒ Object
76
77
78
79
80
|
# File 'lib/edmunds/model_year.rb', line 76
def for_year_make_model(year, make, model)
@url = "/modelyearrepository/foryearmakemodel?year=#{year}&make=#{make}&model=#{model}&"
call_api
@json["modelYearHolder"]
end
|