vehicle_coding_ph 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce3082de37eaf01f116650c3f08c65c42a5ff17ab5ccbbb0eb2063f4e7cbb408
4
- data.tar.gz: a90fcd77170c3698f7bbf67233fa59ce5d1ca31d69fc4e3d25b5fe069052cc31
3
+ metadata.gz: c5c4f4e63a646bcb16fe9a50366e1438e8465939b815a376192c857fdc0aac31
4
+ data.tar.gz: 6f71b895af80dde97f34114daaa78d1cd529f6fb8a94f4429225b83c115d84a9
5
5
  SHA512:
6
- metadata.gz: 0c04dafd33bd52e31b21c145319eb2b0b766463af48e10aa7125171c7683cbd7004a92d9099a8a1d6fbedd16320de7fa074e5d6e46c52d5e80181523ae9c0c6e
7
- data.tar.gz: 76e02fd654d3ab61e9eaada8f0fed98c17716c032616071552976376961f7e6aa98168df701a3c73150a6a920dde5567c9637791353a775adc2bdd2aa62ede89
6
+ metadata.gz: 1cf62292fc9e3bc19b52236f14355637d1a7be5cde2d131162e7d2959d8881b8bbecd9555c6e093e0227a94ec3d708e4558b135a8ddc3370eda0bdd0bb4a7057
7
+ data.tar.gz: 573fbfe693699c44ba9d4e8ecd038e205c33d21dc215aae6d6f574661e89329eca94e57ea64f390f38f45120b5efb89abc6f33fca7c0108c541ec1d62327cf70
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vehicle_coding_ph (1.0.0)
4
+ vehicle_coding_ph (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -8,8 +8,6 @@ Helps you figure out if your car is legally okay to drive on a given date in the
8
8
 
9
9
  - [x] Response object
10
10
  - [x] Consider window hours
11
- - [ ] Helpful return messages for the Gem users e.g. "areas you're allowed or
12
- not allowed to go to" because areas have particular coding scheme applied
13
11
 
14
12
  ## Installation
15
13
 
@@ -30,16 +28,11 @@ Or install it yourself as:
30
28
  ## Usage
31
29
 
32
30
  ```ruby
33
- result = VehicleCodingPh::Checker.(
31
+ # returns a `VehicleCodingPh::Response` object
32
+ VehicleCodingPh::Checker.(
34
33
  plate_number_of_your_vehicle,
35
34
  datetime # if not passed, defaults to datetime today
36
35
  )
37
-
38
- # result is a hash that has the ff. data structure
39
- {
40
- coding: boolean,
41
- allowed_areas: [] # array of areas in Metro Manila
42
- }
43
36
  ```
44
37
 
45
38
  ## Development
@@ -7,16 +7,17 @@ module VehicleCodingPh
7
7
 
8
8
  hour_of_the_day = datetime.hour
9
9
 
10
- allowed_areas = VehicleCodingPh::AREA_TO_HOUR_MAPPING.reduce([]) do |hash, mapping|
11
- hash ||= []
12
- area = mapping[0]
10
+ allowed_areas = VehicleCodingPh::AREA_TO_HOUR_MAPPING.reduce([]) do |areas, mapping|
11
+ areas ||= []
12
+
13
+ name_of_area = mapping[0]
13
14
  coding_hours = mapping[1]
14
15
 
15
16
  if coding_hours.empty? || !coding_hours.include?(hour_of_the_day)
16
- hash << area
17
+ areas << name_of_area
17
18
  end
18
19
 
19
- hash
20
+ areas
20
21
  end
21
22
 
22
23
  Response.new(true, allowed_areas)
@@ -1,3 +1,3 @@
1
1
  module VehicleCodingPh
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vehicle_coding_ph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Chavez