class Nhtsa::CivilPenalties::CivilPenaltiesByYear

Public Class Methods

new(year) click to toggle source
# File lib/nhtsa/civil_penalties/civil_penalties_by_year.rb, line 4
def initialize(year)
  @year = year
end

Public Instance Methods

civil_penalties_by_year() click to toggle source
# File lib/nhtsa/civil_penalties/civil_penalties_by_year.rb, line 12
def civil_penalties_by_year
  JSON.parse(open(url).read)["Results"]
end
url() click to toggle source
# File lib/nhtsa/civil_penalties/civil_penalties_by_year.rb, line 8
def url
  "#{BASE_URI}#{END_POINT}/#{@year}#{DEFAULT_PARAMS}"
end