Class: Nhtsa::Recalls::Manufacturers
- Inherits:
-
Object
- Object
- Nhtsa::Recalls::Manufacturers
- Defined in:
- lib/nhtsa/recalls/manufacturers.rb
Instance Method Summary collapse
-
#initialize(year) ⇒ Manufacturers
constructor
A new instance of Manufacturers.
- #manufacturers ⇒ Object
- #url ⇒ Object
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
#manufacturers ⇒ Object
12 13 14 |
# File 'lib/nhtsa/recalls/manufacturers.rb', line 12 def manufacturers JSON.parse(open(url).read)["Results"].collect{|manufacturer| manufacturer["Make"]} end |
#url ⇒ Object
8 9 10 |
# File 'lib/nhtsa/recalls/manufacturers.rb', line 8 def url BASE_URI + END_POINT + "/#{@year}" + DEFAULT_PARAMS end |