pig_sniffer 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fac938776ae099302f38067b1b769bae20345740
4
- data.tar.gz: 58e99c48d28ad70ff9732b8808231f7c74ba857c
3
+ metadata.gz: 3e155fd2aaaa70de61d70143d93dbc6152479f26
4
+ data.tar.gz: 38b2db3400fc2577f58601e480658d101c0e2cf7
5
5
  SHA512:
6
- metadata.gz: fec7bcb220e719a3858579419a1fd9092a48a6966dffc4fdaceebdc577bc34a216550539e7e7fe45671b72ff35c0f0dcfc8f5327a5e2dc4b8a680ce382a8ea8d
7
- data.tar.gz: dfe4a42064ff232bf23a1c6014e1ca5dae246ab004e2b722e7ea39e3c21efcb0f6536ad61904769b28a38de734df53276cd31bbbf16ae3e45b39bf43bbb1e39e
6
+ metadata.gz: 554d4c1d8db3b188dfa04c2fad28c038ed911dc544844f579294cf4c342d1fa423faaa2188e442d16137bbd97850253a8e70b838516e2e0ac6aa6a21c00693c1
7
+ data.tar.gz: 07500bce2cf2d5bc8a465a7fbe323f8b0c588c847f5d2864aab995bd6acbb860e3eee571d550b938839eb06b22fa686d4f080f52836a42d66d221cbb2976d768
data/README.md CHANGED
@@ -28,10 +28,10 @@ Finds All Police stations in chicago
28
28
  police = PigSniffer::Police.all
29
29
 
30
30
  ```
31
- search by department
31
+ search by Address
32
32
 
33
33
  ```ruby
34
- police = PigSniffer::Police.search('headquarters')
34
+ police = PigSniffer::Police.search_address('1718 S State St')
35
35
  ```
36
36
 
37
37
  ## Development
@@ -8,29 +8,26 @@ module PigSniffer
8
8
  attr_reader :zip, :location, :address, :state, :district, :city
9
9
 
10
10
  def initialize(police_api_info)
11
-
12
11
  @zip = police_api_info["zip"]
13
12
  @location = police_api_info["location"]
14
13
  @address = police_api_info["address"]
15
14
  @state = police_api_info["state"]
16
15
  @district = police_api_info["district"]
17
16
  @city = police_api_info["city"]
18
-
19
- end
17
+ end
20
18
 
21
19
 
22
20
  def self.all
23
21
  api_array = Unirest.get('https://data.cityofchicago.org/resource/z8bn-74gv.json').body
24
22
  police_stations = []
25
-
26
23
  api_array.each do |station|
27
24
  police_stations << Police.new(station)
28
25
  end
29
26
  police_stations
30
27
  end
31
28
 
32
- def self.search(search_keyword)
33
- api_array = Unirest.get("https://data.cityofchicago.org/resource/z8bn-74gv.json$q=#{search_keyword}").body
29
+ def self.search_address(search_address)
30
+ api_array = Unirest.get("https://data.cityofchicago.org/resource/z8bn-74gv.json?address=#{search_address}").body
34
31
  police_stations = []
35
32
 
36
33
  police_stations = []
@@ -1,3 +1,3 @@
1
1
  module PigSniffer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pig_sniffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Monzon