loan_creator 0.2.0 → 0.2.1

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: 9aa67fe88f64cf983f07ee79e4fffd9c124a6a79
4
- data.tar.gz: 8c953567926083ae563102f9001d21adb770d4f9
3
+ metadata.gz: c512fd6d25322111e992b4a6b8cbf24ed2ef492e
4
+ data.tar.gz: 67a1fdc42b417b91ca5ef72b1aeb9e136aa95a68
5
5
  SHA512:
6
- metadata.gz: 407a1e8724d0dcba174d7c41991d034432f13aea6864d6db898fb0ac9db85fdacb391b9f676782d4b9e7085b6a49f861278938061c671b3622d8631a44932662
7
- data.tar.gz: 8feda4e05585c7337c9a4d6ca15bc65d1aaecbf7598c1497690d535d025587de1c0b9e5b473d89be955cde55ca0c8df6e8798b09e1be1ea608dfea67542473d1
6
+ metadata.gz: af89b4866718ebb10a136c9fb3e6a1c7d54830a398cb0c972677d5472dbe0541bc9c5eac32b137efdbd685fda7f5ef95b0807016fe0f161cc77e0b4287cb3677
7
+ data.tar.gz: 3c1b146323de4de7d20f597af5ba58c9a509f0131a48b34a1a83a080f42102ae4017cccee613dd2ec63fd5ebc6fae4e6e4c1c7a817276a8a6c433839c1c02722
@@ -28,6 +28,7 @@ module LoanCreator
28
28
  def initialize(**options)
29
29
  @options = options
30
30
  require_attributes
31
+ reinterpret_attributes
31
32
  set_attributes
32
33
  validate_attributes
33
34
  end
@@ -60,6 +61,12 @@ module LoanCreator
60
61
  REQUIRED_ATTRIBUTES.each { |k| raise ArgumentError.new(k) unless @options.fetch(k, nil) }
61
62
  end
62
63
 
64
+ def reinterpret_attributes
65
+ @options[:period] = @options[:period].to_sym
66
+ @options[:amount] = bigd(@options[:amount])
67
+ @options[:annual_interests_rate] = bigd(@options[:annual_interests_rate])
68
+ end
69
+
63
70
  def set_attributes
64
71
  REQUIRED_ATTRIBUTES.each { |k| instance_variable_set(:"@#{k}", @options.fetch(k)) }
65
72
  OPTIONAL_ATTRIBUTES.each { |k,v| instance_variable_set(:"@#{k}", @options.fetch(k, v)) }
@@ -1,3 +1,3 @@
1
1
  module LoanCreator
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thibaulth