week_calc 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/week_calc.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 094cf09299c48b55411574da96001af0bc80eb11
4
- data.tar.gz: 9b9a7d7b013e3fb16f789544ed7c13d1db9e5fa6
3
+ metadata.gz: 1a072585efe5857ff1439e3cb3170d09f7884b26
4
+ data.tar.gz: f52cf7511fea92c40f53b997a25af616838479ea
5
5
  SHA512:
6
- metadata.gz: 8f819a13dbe196092ed0d650dc9c32312a5325d05e04f6cfbc0ab7b2cd1fafabf8a2407f36bb3d76204e34eb1c7011fbf5493a993b2ab4ac8d31673e63f1f9e2
7
- data.tar.gz: aaa1f1a917f497c559b224b27e05ca186f80d2bd305e92fcbd3e1ddf43d7757346a74f7cffbfad014ff3a8c1b2f605d0ea932dce6d5ad018cf25658e18ea191c
6
+ metadata.gz: 2d5d485e9fb659105c66a7999671667a4876ea2a8b1b525725a9a73da1f79b5bfe9785c9be063b10b8137aae6119a7d3cc2cb653b140a2ef98c4030d44529d10
7
+ data.tar.gz: cecdc2768712e494658c83121a11ba555e91813e1a89d5be023b64783fb50f267dffd3ba966a10507250998bfe380860473e90916bff64e32afd3517a45a24c8
data/lib/week_calc.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'date'
2
2
  Date.class_eval do
3
- def self.get_weeks(start_date, end_date)
3
+ def self.weeks_in_between(start_date, end_date)
4
4
  #Calculations will return a date object
5
5
  start_date_parsed = Date.parse(start_date) rescue nil
6
6
  end_date_parsed = Date.parse(end_date) rescue nil
@@ -12,7 +12,7 @@ Date.class_eval do
12
12
  end
13
13
  end
14
14
 
15
- def self.week_from_now(date)
15
+ def self.weeks_from_now(date)
16
16
  date_parsed = Date.parse(date) rescue nil
17
17
  if date_parsed.nil?
18
18
  nil
@@ -21,4 +21,9 @@ Date.class_eval do
21
21
  weeks = (days_gap/7).abs
22
22
  end
23
23
  end
24
+
25
+ # Method Aliases
26
+ class << self
27
+ alias_method :weeks_till_now, :weeks_from_now
28
+ end
24
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: week_calc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Souranil Sen, Amit Suryavanshi, Yashasree Barve, Twinkal Savani, Priya Joshi