class Nhtsa::Recalls::Models
Public Class Methods
new(year, manufacturer)
click to toggle source
# File lib/nhtsa/recalls/models.rb, line 4 def initialize(year, manufacturer) @year = year @manufacturer = URI::encode(manufacturer) end
Public Instance Methods
models()
click to toggle source
# File lib/nhtsa/recalls/models.rb, line 13 def models JSON.parse(open(url).read)["Results"].collect{|model| model["Model"]} end
url()
click to toggle source
# File lib/nhtsa/recalls/models.rb, line 9 def url "#{BASE_URI}#{END_POINT}/#{@year}/#{@manufacturer}#{DEFAULT_PARAMS}" end