roi_calculator 0.3.1 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/lib/roi/rentability.rb +1 -1
- data/lib/roi/rentability_periods.rb +12 -1
- data/lib/roi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d374c0e5a2f5bc8659091bcdb627b31f9da5bada6bc92de1d3334c532eb704dd
|
4
|
+
data.tar.gz: d938f830840cbb8cb8de02ac6ebbb092968cf4c912e6b2575aecfe1847ed20e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1be3092e3cb334a65cd96f3763daf591e2c4b57c115ccdded5d4b142849f1bb96c34b420f1f1e78df9a4e8f240bcb73d4f6ddf9a7e7e74dce88de5583e246d49
|
7
|
+
data.tar.gz: 2f00910f9eb75e1a6a65058aef5b0c4b87a9b82a89a80c59fdc584f180d3a666ea15c62366a1639f857d9aae8ad85d6c8eb752535d32752161b059a1d2b6a0a1
|
data/Gemfile
CHANGED
data/lib/roi/rentability.rb
CHANGED
@@ -12,11 +12,22 @@ module ROI
|
|
12
12
|
check_gaps_and_format(adjust_start_date(scoped_start), end_date)
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def month(date = end_date)
|
16
|
+
return current_month if date == end_date
|
17
|
+
|
18
|
+
scoped_start = WorkDay.last_until((date - 1.month).end_of_month)
|
19
|
+
scoped_end = adjust_end_date(date)
|
20
|
+
check_gaps_and_format(scoped_start, scoped_end)
|
21
|
+
end
|
22
|
+
|
23
|
+
def months_ago(amount, date = end_date)
|
24
|
+
return current_month if amount == 1 && date == end_date
|
25
|
+
|
16
26
|
scoped_start = WorkDay.last_until((date - (amount+1).month).end_of_month)
|
17
27
|
scoped_end = adjust_end_date((date - 1.month).end_of_month)
|
18
28
|
check_gaps_and_format(scoped_start, scoped_end)
|
19
29
|
end
|
30
|
+
alias_method :months, :months_ago
|
20
31
|
|
21
32
|
def current_year
|
22
33
|
scoped_start = WorkDay.last_until((end_date - 1.year).end_of_year)
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adriano Bacha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|