Class: Nhtsa::Recalls::Manufacturers
- Inherits:
-
Object
- Object
- Nhtsa::Recalls::Manufacturers
- Defined in:
- lib/nhtsa/recalls.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.
19 20 21 |
# File 'lib/nhtsa/recalls.rb', line 19 def initialize(year) @year = year end |
Instance Method Details
#manufacturers ⇒ Object
27 28 29 |
# File 'lib/nhtsa/recalls.rb', line 27 def manufacturers JSON.parse(open(url).read)["Results"].collect{|manufacturer| manufacturer["Make"]} end |
#url ⇒ Object
23 24 25 |
# File 'lib/nhtsa/recalls.rb', line 23 def url BASE_URI + END_POINT + "/#{@year}" + DEFAULT_PARAMS end |