bank_working_day 0.1.2 → 0.1.4

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: a1b1f71afe267ee00b989a8e9619cc52c4b08477
4
- data.tar.gz: e63f3d1968ac99ee6372ad1121ac66206f567948
3
+ metadata.gz: d7819f8bbe6e234344d9b01e486309bfac37d632
4
+ data.tar.gz: 6d6c75e5fdc5291b8345160bf65fe3405efdec7b
5
5
  SHA512:
6
- metadata.gz: 1e6e7b387c4d44b7f32938f24694a076f319c5816f50166de53bbaba39c182f381c0e1f9aedbdefac0441e9a9399a59547c8cd88d3f9c4f2513728085f5f0ebf
7
- data.tar.gz: 1cd40db7411ed529be8420cc023e32b0fe2a9e83d1491cdbe70d8180e5428e89889b710aedd0f95568da2a6799885278ef959566723faa5184cafbba0803ff09
6
+ metadata.gz: 133a13dd9e97641e5bc75361bf48f674309b477d55dfb06b450b71045234b64627a7434f6e2ade91696124298e0e29eeb1118d6f6746da21f0419f3ca6b188f7
7
+ data.tar.gz: feda99f6e20df5a90fe4873caea9bd43b3a6c16e22ce647e15942fcbc04eeb3125685ee7142f74e3359747018319806951f74a614a197a3a52d328fed328e9f5
@@ -29,6 +29,17 @@ module BankWorkingDay
29
29
  date
30
30
  end
31
31
 
32
+ def self.deduction_date(year: , month: , day: 27)
33
+ raise InvalidArgumentError if year.to_i.zero? || month.to_i.zero?
34
+
35
+ date = Date.new(year.to_i, month.to_i, day.to_i)
36
+ while holiday?(date)
37
+ date += 1
38
+ end
39
+
40
+ date
41
+ end
42
+
32
43
  def self.holiday?(date)
33
44
  holidays.holiday?(date)
34
45
  end
@@ -1,3 +1,3 @@
1
1
  module BankWorkingDay
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_working_day
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morioka Shuhei