Module: ChicagoCrime

Defined in:
lib/chicago_crime.rb,
lib/chicago_crime/crime.rb,
lib/chicago_crime/version.rb

Defined Under Namespace

Classes: Crime

Constant Summary collapse

BASE_URL =
"http://data.cityofchicago.org/resource/ijzp-q8t2.json"
VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.allObject



9
10
11
12
13
14
15
16
# File 'lib/chicago_crime.rb', line 9

def self.all
  crime_hashes = Unirest.get(BASE_URL).body
  crimes = []
  crime_hashes.each do |hash|
    crimes << Crime.new(hash)
  end
  return crimes
end