class ChicagoTowedVehicles::TowedVehicle

Attributes

color[R]
make[R]
plate[R]
towed_to_address[R]

Public Class Methods

all() click to toggle source
# File lib/chicago_towed_vehicles.rb, line 15
def self.all
  vehicles_array = Unirest.get("https://data.cityofchicago.org/resource/rp42-fxjt.json").body

  vehicles = []
  vehicles_array.each do |vehicle_hash|
    vehicles << TowedVehicle.new(vehicle_hash)
  end
  return vehicles
end
new(hash) click to toggle source
# File lib/chicago_towed_vehicles.rb, line 8
def initialize(hash)
  @color = hash["color"]
  @make = hash["make"]
  @plate = hash["plate"]
  @towed_to_address = hash["towed_to_address"]
end