business_calendar 3.0.0 → 3.0.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: beb100bc24dbbd90684a3c07a5201b9608534d9d2a3a26807e59d2b646eb4579
4
- data.tar.gz: b456e4a40d119ebf60e822ecd2f07751c4971f5694e8dd0a2496fccc3226768b
3
+ metadata.gz: 7b390e3954573c98a996c9839374b3f2802f3ecb81d0815f62d28fc36b294c62
4
+ data.tar.gz: 7b5aeebc620e1c5c80b70a3359cb01cef43e7d27c3ca0778d7e13eeab5f17c58
5
5
  SHA512:
6
- metadata.gz: 9b827ee58fe6bec07fc210d3928acea4f5aec538e059ad639cc07dc97dd969837b3c33f778c860a2a5445a89352bac2d706d3ecee6f1a2933016ddb460886ce5
7
- data.tar.gz: abe89b5c64c4a84fa1aaa7b21533eed255983efa6da080ddc1911328cc45c83b8cf804dd71bf079a4c433195f3f0eb1665602ba6f9c46c9b3c5a1c0a8d759377
6
+ metadata.gz: 975c687a0f0ea409e5c6a97116fe00807a2b14d4bfb85a9a43a575ce07549b30fa11f7ca2bd3b417f560df53842e450a24d1c564dbabf1481974bac77f4e2a98
7
+ data.tar.gz: bf9427e07ab653c90537a41b8f2b4e9cb95b09d9ec407c764b6b6fc9e3aa12037f1934c9cfe389626419f35e187578555681880a074efeeff49ae7e91590d90a
@@ -2,7 +2,7 @@ require 'holidays'
2
2
 
3
3
  class BusinessCalendar::HolidayDeterminer
4
4
  DEFAULT_TIME_TO_LIVE = 24 * 60 * 60
5
- attr_reader :regions, :holiday_names, :additions, :removals, :additions_only
5
+ attr_reader :regions, :holiday_names, :additions_only
6
6
 
7
7
  def initialize(regions, holiday_names, opts = {})
8
8
  ttl = opts[:ttl]
@@ -27,6 +27,14 @@ class BusinessCalendar::HolidayDeterminer
27
27
  end
28
28
  end
29
29
 
30
+ def additions
31
+ @additions_cache ||= @additions.is_a?(Proc) ? @additions.call : @additions
32
+ end
33
+
34
+ def removals
35
+ @removals_cache ||= @removals.is_a?(Proc) ? @removals.call : @removals
36
+ end
37
+
30
38
  private
31
39
 
32
40
  def should_clear_cache?
@@ -40,12 +48,4 @@ class BusinessCalendar::HolidayDeterminer
40
48
  @additions_cache = nil
41
49
  @removals_cache = nil
42
50
  end
43
-
44
- def additions
45
- @additions_cache ||= @additions.is_a?(Proc) ? @additions.call : @additions
46
- end
47
-
48
- def removals
49
- @removals_cache ||= @removals.is_a?(Proc) ? @removals.call : @removals
50
- end
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module BusinessCalendar
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -47,5 +47,9 @@ describe BusinessCalendar::HolidayDeterminer do
47
47
  it "correctly determines false for dates not in additions, nor exceptions" do
48
48
  expect(subject.call('2101-07-04'.to_date)).to be_falsy
49
49
  end
50
+
51
+ it "lists out the additions" do
52
+ expect(subject.additions).to include('2101-07-05'.to_date)
53
+ end
50
54
  end
51
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: business_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Nubel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: holidays