Class: Nhtsa::Recalls::Manufacturers

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

Instance Method Summary collapse

Constructor Details

#initialize(year) ⇒ Manufacturers

Returns a new instance of Manufacturers.



4
5
6
# File 'lib/nhtsa/recalls/manufacturers.rb', line 4

def initialize(year)
  @year = year
end

Instance Method Details

#manufacturersObject



12
13
14
# File 'lib/nhtsa/recalls/manufacturers.rb', line 12

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

#urlObject



8
9
10
# File 'lib/nhtsa/recalls/manufacturers.rb', line 8

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