roi_calculator 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/roi/rentability_periods.rb +5 -2
- data/lib/roi/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8abe9ea75aac2649c2a444298c24e21c2bfa96d9
|
4
|
+
data.tar.gz: 69d88fdd5969f937e7ff45aee9cf99e04edb3f5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5dc672a2996187b537a72e861bb0bd005c1415ecfb2b781b6331c8bab67c66d136c36eb716777f373d06d92b5e69e368c7f40d2d239fc3fda9aa54e3e5194e3
|
7
|
+
data.tar.gz: ee98cf1a647a80f80b78cac0c024ef0ed42f24a73de44ad8587cca6f0bab9f9c26af14e2771bca1660453c2efd94e688cc39408bd2b881dfeaf059e16bca2a87
|
@@ -23,8 +23,11 @@ module ROI
|
|
23
23
|
def months_ago(amount, date = end_date)
|
24
24
|
return current_month if amount == 1 && date == end_date
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
end_of_month = WorkDay.last_until(date.end_of_month)
|
27
|
+
offset = date == end_of_month ? 0 : 1
|
28
|
+
|
29
|
+
scoped_start = WorkDay.last_until((date - (amount + offset).month).end_of_month)
|
30
|
+
scoped_end = adjust_end_date((date - offset.month).end_of_month)
|
28
31
|
check_gaps_and_format(scoped_start, scoped_end)
|
29
32
|
end
|
30
33
|
alias_method :months, :months_ago
|
data/lib/roi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roi_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adriano Bacha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,7 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.4.8
|
127
128
|
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: Rentability and financial calculations
|