vng 2.2.0 → 2.2.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
  SHA256:
3
- metadata.gz: 4971f6a848df0d985ca1d1d86b735e80fec57624c2214cddf5c8201cdab96a9a
4
- data.tar.gz: 6d4402e9d16b3b75fd8bb76da8773121e5c77d009ee234025a95d61af0928870
3
+ metadata.gz: 240226a07b22399db9b611a1651c0ca709b931620ac224e7ac01e2e289e4cd97
4
+ data.tar.gz: f10775485ccc1b6cdc9a9873a5a9296b4ac4fb2796f4d1a2afadb7eec1165264
5
5
  SHA512:
6
- metadata.gz: 501643766b5bf72d595c0f45ab0b1ec8f0c445660e996ccbc39600b2f6d3ef97d84a8d1acf7f5b7be9db764926f01569bf4a0f0bd8d4faa72799250afbed4174
7
- data.tar.gz: bcfd00e8cb492e7c62fe48a57c439960218acc580ef7e2fce68786774346dea12ef3c47e6f5f9317f036cd6d6b3391c3abb33d4791c6b2d8517e6539156568a5
6
+ metadata.gz: a61c7417e857912b88ef45a013e0567a1f3fdbf6c43b2a2a3cb8d8c390dc2830c590da0c0af7d5b6915a2fd702ce84f30876c042a7571d68ef4b68b11c6313fd
7
+ data.tar.gz: 31369f5292794ec854e41dc6a40537e9f5a25d3ba4d4e74c1ec02494bf97920a6a9ca82e8c022c0f841d1953fd57a89e2eb3248554f1c156957ac3c8c8219eeb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [2.2.1] - 2025-01-02
2
+
3
+ - Always return an array for .all methods
4
+ - Discard ZIP codes 'Owned - Not In Service'
5
+
1
6
  ## [2.2.0] - 2025-01-02
2
7
 
3
8
  - Adds Franchise#cell and Franchise#phone
@@ -12,7 +17,7 @@
12
17
 
13
18
  ## [2.0.0] - 2024-12-26
14
19
 
15
- ** Breaking changes**
20
+ **Breaking changes**
16
21
 
17
22
  - Remove ServiceType.all and ServiceType.where(zip:)
18
23
 
@@ -28,7 +28,7 @@ module Vng
28
28
 
29
29
  data = request path: PATH, body: body
30
30
 
31
- data['Availability'].map do |availability|
31
+ data.fetch('Availability', []).map do |availability|
32
32
  route_id = availability['routeID'].to_i
33
33
  date = Date.strptime availability['dayID'], '%Y%m%d'
34
34
  minutes = availability['startTime'].to_i
data/lib/vng/breed.rb CHANGED
@@ -19,7 +19,7 @@ module Vng
19
19
  def self.all
20
20
  data = request path: PATH
21
21
 
22
- data['Breeds'].map do |breed|
22
+ data.fetch('Breeds', []).map do |breed|
23
23
  id = breed['breedID']
24
24
  name = breed['breed']
25
25
  species = breed['species']
data/lib/vng/franchise.rb CHANGED
@@ -46,7 +46,7 @@ module Vng
46
46
  def self.all
47
47
  data = request path: PATH
48
48
 
49
- data['Franchises'].filter do |franchise|
49
+ data.fetch('Franchises', []).filter do |franchise|
50
50
  franchise['isActive']
51
51
  end.map do |franchise|
52
52
  id = franchise['franchiseID']
@@ -54,7 +54,11 @@ module Vng
54
54
  { "Zip"=>{"zipCodeID"=>"1", "zipCode"=>"21765", "zoneName"=>"Brentwood", "defaultCity"=>"Los Angeles", "provinceAbbr"=>"CA", "franchiseID"=>"105"},
55
55
  "ServiceTypes"=>[{"serviceTypeID"=>14, "serviceType"=>"Pet Grooming", "duration" => 45}]}
56
56
  else
57
- { "Zips"=>[{ "zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD" }] }
57
+ { "Zips"=>[
58
+ { "zip"=>"21763", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned - Not In Service" },
59
+ { "zip"=>"21764", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned – Deactivated" },
60
+ { "zip"=>"21765", "zoneName"=>"Brentwood", "state"=>"MD", "zipStatus"=>"Owned - Currently Serviced" },
61
+ ] }
58
62
  end
59
63
  when '/api/v1/resources/franchises/'
60
64
  if @body.key?(:objectID)
@@ -15,7 +15,7 @@ module Vng
15
15
  def self.all
16
16
  data = request path: PATH
17
17
 
18
- data['PriceLists'].filter_map do |price_list|
18
+ data.fetch('PriceLists', []).filter_map do |price_list|
19
19
  next unless price_list['isActive']
20
20
  next unless price_list['serviceTypeID'].eql?(14)
21
21
 
data/lib/vng/route.rb CHANGED
@@ -15,7 +15,7 @@ module Vng
15
15
  def self.all
16
16
  data = request path: PATH
17
17
 
18
- data['Routes'].filter do |route|
18
+ data.fetch('Routes', []).filter do |route|
19
19
  route['isActive']
20
20
  end.map do |body|
21
21
  id = body['routeID']
data/lib/vng/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vng
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
data/lib/vng/zip.rb CHANGED
@@ -19,9 +19,8 @@ module Vng
19
19
  def self.all
20
20
  data = request path: PATH
21
21
 
22
- data['Zips'].reject do |franchise|
23
- # TODO: add "Owned - Not In Service"
24
- franchise['zipStatus'].eql? 'Owned – Deactivated'
22
+ data.fetch('Zips', []).reject do |franchise|
23
+ ['Owned Deactivated', 'Owned - Not In Service'].include? franchise['zipStatus']
25
24
  end.map do |body|
26
25
  zip = body['zip']
27
26
  state = body['state']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vng
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob