class Nhtsa::Recalls::Recalls

Public Class Methods

new(year, manufacturer, model) click to toggle source
# File lib/nhtsa/recalls/recalls.rb, line 4
def initialize(year, manufacturer, model)
  @year = year
  @manufacturer = URI::encode(manufacturer)
  @model = URI::encode(model)
end

Public Instance Methods

recalls() click to toggle source
# File lib/nhtsa/recalls/recalls.rb, line 14
def recalls
  JSON.parse(open(url).read)["Results"]
end
url() click to toggle source
# File lib/nhtsa/recalls/recalls.rb, line 10
def url
  "#{BASE_URI}#{END_POINT}/#{@year}/#{@manufacturer}/#{@model}#{DEFAULT_PARAMS}"
end