Class: Edmunds::Make

Inherits:
API
  • Object
show all
Defined in:
lib/edmunds/make.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_allObject

Makes



4
5
6
7
8
# File 'lib/edmunds/make.rb', line 4

def find_all
  @url = "/makerepository/findall?"
  call_api
  @json["makeHolder"]
end

#find_by_id(make_id) ⇒ Object



10
11
12
13
14
# File 'lib/edmunds/make.rb', line 10

def find_by_id(make_id)
  @url = "/makerepository/findbyid?id=#{make_id}&"
  call_api
  @json["makeHolder"]
end

#find_future_makesObject



16
17
18
19
20
# File 'lib/edmunds/make.rb', line 16

def find_future_makes
  @url = "/makerepository/findfuturemakes?"
  call_api
  @json["makeHolder"]
end

#find_make_by_name(make_name) ⇒ Object



22
23
24
25
26
# File 'lib/edmunds/make.rb', line 22

def find_make_by_name(make_name)
  @url = "/makerepository/findmakebyname?name=#{make_name}&"
  call_api
  @json["makeHolder"]
end

#find_makes_by_model_year(model_year) ⇒ Object



28
29
30
31
32
# File 'lib/edmunds/make.rb', line 28

def find_makes_by_model_year(model_year)
  @url = "/makerepository/findmakesbymodelyear?year=#{model_year}&"
  call_api
  @json["makeHolder"]
end

#find_makes_by_publication_state(condition) ⇒ Object



34
35
36
37
38
39
# File 'lib/edmunds/make.rb', line 34

def find_makes_by_publication_state(condition)
  # should either be "new" or "used"
  @url = "/makerepository/findmakesbypublicationstate?state=#{condition}&"
  call_api
  @json["makeHolder"]
end

#find_new_and_usedObject



41
42
43
44
45
# File 'lib/edmunds/make.rb', line 41

def find_new_and_used
  @url = "/makerepository/findnewandused?"
  call_api
  @json["makeHolder"]
end

#find_new_and_used_makes_by_model_year(year) ⇒ Object



47
48
49
50
51
# File 'lib/edmunds/make.rb', line 47

def find_new_and_used_makes_by_model_year(year)
  @url = "/makerepository/findnewandusedmakesbymodelyear?year=#{year}&"
  call_api
  @json["makeHolder"]
end

#find_new_makesObject



53
54
55
56
57
# File 'lib/edmunds/make.rb', line 53

def find_new_makes
  @url = "/makerepository/findnewmakes?"
  call_api
  @json["makeHolder"]
end

#find_used_makesObject



59
60
61
62
63
# File 'lib/edmunds/make.rb', line 59

def find_used_makes
  @url = "/makerepository/findusedmakes?"
  call_api
  @json["makeHolder"]
end