roi_calculator 0.3.4 → 0.3.5

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: 742359729479af856a33099a99aad954d50fe7445e6fbb8f221008272c1bd8cd
4
- data.tar.gz: 39eea60eeb06a848aab1a260a7e875354e040d272176cfd166f2996ae1dfc930
3
+ metadata.gz: 28fdc603ec087be038354ae4b2598066e254839306da2ae5e3ce1f9b9c949c93
4
+ data.tar.gz: 3d87f3a27f6b55acc5145cdd6ab1700ab145f338ff31dc695972254816553905
5
5
  SHA512:
6
- metadata.gz: b26f8058b6e6fcaf18ceacc8e2d75e0acc9be863860a4a566c534a4eba18098e4f17e2825155b7fc820cfba5bbaa0ab82d242990990ed8203a88ae422a6136d2
7
- data.tar.gz: '08f8270cfb4213c09ef019c951ba873f39003242c3d2ae147680211acb95b3061516b12c2f02668ddbfed97b114d9419f4fef435dc791bdc282a6bad9247585b'
6
+ metadata.gz: 2d3b8f264709e29e71dfccb3fcd1b17e7c88eb363185adf7a8e5d48f573b8e4b7d924e36795ff0988e8953a2b7591ce981ff59c624ad1e1031e2eb24913c5bd6
7
+ data.tar.gz: 6358ee37541ea90a0c39134be3134d7ac996dfc50309d82084f19ccaaff4a6deef3cc7e43667b992b4a493a4f48dfdebaaafa679fc35df2a1a5edec4a8871cd2
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+ gem 'pry'
@@ -12,13 +12,20 @@ module ROI
12
12
  check_gaps_and_format(adjust_start_date(scoped_start), end_date)
13
13
  end
14
14
 
15
- def months(amount, date = end_date)
15
+ def month(date = end_date)
16
+ scoped_start = WorkDay.last_until((date - 1.month).end_of_month)
17
+ scoped_end = adjust_end_date(date)
18
+ check_gaps_and_format(scoped_start, scoped_end)
19
+ end
20
+
21
+ def months_ago(amount, date = end_date)
16
22
  return current_month if amount == 1 && date == end_date
17
23
 
18
24
  scoped_start = WorkDay.last_until((date - (amount+1).month).end_of_month)
19
25
  scoped_end = adjust_end_date((date - 1.month).end_of_month)
20
26
  check_gaps_and_format(scoped_start, scoped_end)
21
27
  end
28
+ alias_method :months, :months_ago
22
29
 
23
30
  def current_year
24
31
  scoped_start = WorkDay.last_until((end_date - 1.year).end_of_year)
@@ -1,3 +1,3 @@
1
1
  module ROI
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roi_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha