Class: Nhtsa::Recalls::Manufacturers

Inherits:
Object
  • Object
show all
Defined in:
lib/nhtsa/recalls.rb

Instance Method Summary collapse

Constructor Details

#initialize(year) ⇒ Manufacturers

Returns a new instance of Manufacturers.



19
20
21
# File 'lib/nhtsa/recalls.rb', line 19

def initialize(year)
  @year = year
end

Instance Method Details

#manufacturersObject



27
28
29
# File 'lib/nhtsa/recalls.rb', line 27

def manufacturers
  JSON.parse(open(url).read)["Results"].collect{|manufacturer| manufacturer["Make"]}
end

#urlObject



23
24
25
# File 'lib/nhtsa/recalls.rb', line 23

def url
  BASE_URI + END_POINT + "/#{@year}" + DEFAULT_PARAMS
end