loan_creator 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c512fd6d25322111e992b4a6b8cbf24ed2ef492e
4
- data.tar.gz: 67a1fdc42b417b91ca5ef72b1aeb9e136aa95a68
3
+ metadata.gz: b6e2efd8ec4e40134c45e8fb041c5bad28a01142
4
+ data.tar.gz: 0c01a9e96e5034fe643282ffa197964b71b9f5d6
5
5
  SHA512:
6
- metadata.gz: af89b4866718ebb10a136c9fb3e6a1c7d54830a398cb0c972677d5472dbe0541bc9c5eac32b137efdbd685fda7f5ef95b0807016fe0f161cc77e0b4287cb3677
7
- data.tar.gz: 3c1b146323de4de7d20f597af5ba58c9a509f0131a48b34a1a83a080f42102ae4017cccee613dd2ec63fd5ebc6fae4e6e4c1c7a817276a8a6c433839c1c02722
6
+ metadata.gz: 18020aec997d4528844265be2784020fc2090721359a903ac46711ece2427d270f458a780e974041d9b9bd0ce939f68b70b39e7abcbbf0a72e64e1a1b38424a9
7
+ data.tar.gz: d42f5ce036d26903e174cad13b658dadf0a21c71ffc07226677ef26e392a3b8a6a68dddea54bd6de6fdaccfd3218e342364150e6d92f03c08c7f732730d77172
@@ -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
@@ -43,7 +43,7 @@ module LoanCreator
43
43
 
44
44
  # Term date
45
45
  # This value is to be set by Timetable
46
- :date,
46
+ :due_on,
47
47
 
48
48
  # These values are to be specified during Term's initialization
49
49
  *ARGUMENTS
@@ -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.date = autoincrement_date
24
+ term.due_on = autoincrement_date
25
25
  @terms << term
26
26
  self
27
27
  end
28
28
 
29
- def reset_indexes_and_dates
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[:date] = autoincrement_date
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
@@ -1,3 +1,3 @@
1
1
  module LoanCreator
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loan_creator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thibaulth