loan_creator 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/loan_creator/common.rb +1 -0
- data/lib/loan_creator/term.rb +1 -1
- data/lib/loan_creator/timetable.rb +4 -4
- data/lib/loan_creator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6e2efd8ec4e40134c45e8fb041c5bad28a01142
|
4
|
+
data.tar.gz: 0c01a9e96e5034fe643282ffa197964b71b9f5d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18020aec997d4528844265be2784020fc2090721359a903ac46711ece2427d270f458a780e974041d9b9bd0ce939f68b70b39e7abcbbf0a72e64e1a1b38424a9
|
7
|
+
data.tar.gz: d42f5ce036d26903e174cad13b658dadf0a21c71ffc07226677ef26e392a3b8a6a68dddea54bd6de6fdaccfd3218e342364150e6d92f03c08c7f732730d77172
|
data/lib/loan_creator/common.rb
CHANGED
@@ -65,6 +65,7 @@ module LoanCreator
|
|
65
65
|
@options[:period] = @options[:period].to_sym
|
66
66
|
@options[:amount] = bigd(@options[:amount])
|
67
67
|
@options[:annual_interests_rate] = bigd(@options[:annual_interests_rate])
|
68
|
+
@options[:starts_at] = @options[:starts_at].strftime('%Y-%m-%d') if Date === @options[:starts_at]
|
68
69
|
end
|
69
70
|
|
70
71
|
def set_attributes
|
data/lib/loan_creator/term.rb
CHANGED
@@ -21,17 +21,17 @@ module LoanCreator
|
|
21
21
|
def <<(term)
|
22
22
|
raise ArgumentError.new('LoanCreator::Term expected') unless LoanCreator::Term === term
|
23
23
|
term.index = autoincrement_index
|
24
|
-
term.
|
24
|
+
term.due_on = autoincrement_date
|
25
25
|
@terms << term
|
26
26
|
self
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
29
|
+
def reset_indexes_and_due_on_dates
|
30
30
|
@autoincrement_index = 0
|
31
31
|
@autoincrement_date = @starts_at
|
32
32
|
@terms.each do |term|
|
33
33
|
term[:index] = autoincrement_index
|
34
|
-
term[:
|
34
|
+
term[:due_on] = autoincrement_date
|
35
35
|
end
|
36
36
|
self
|
37
37
|
end
|
@@ -51,7 +51,7 @@ module LoanCreator
|
|
51
51
|
@autoincrement_index += 1
|
52
52
|
end
|
53
53
|
|
54
|
-
# First term date of timetable term is the starts_at given date
|
54
|
+
# First term due_on date of timetable term is the starts_at given date
|
55
55
|
def autoincrement_date
|
56
56
|
@autoincrement_date ||= @starts_at
|
57
57
|
date = @autoincrement_date
|
data/lib/loan_creator/version.rb
CHANGED