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