instant_quote 1.7.4 → 1.7.5

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
  SHA256:
3
- metadata.gz: 15d07ba008846c863937a179a6d330833031b4291a595f30bf0701980a3c1bc0
4
- data.tar.gz: 102ede083d49fc37c21ab29277e8eed0433fe4961dca1bffb9576c641b002894
3
+ metadata.gz: d3c6acea05a3366244faddff8a23e6f409970dcaeeeb1f41cf141f3147661291
4
+ data.tar.gz: 2e3cd2251bd0fc37ca3e30ba5c334492c78ec0063405f6573159d85e3bb84506
5
5
  SHA512:
6
- metadata.gz: 00b3e2c8bb67d19a2e2be46bd261404bf0763a2876d1a32fbdd1bcbe8f584759485c3566d7c049a511958ae0a02c8cd4c7a6987647d822e1715e62196b8af315
7
- data.tar.gz: 4c85a4d8f1d65aae349b62c2defb1d01e5342444ed2a345da25b3f7e27d0e77a37a08d947e9c2a743f4d80e9c511c2e77797385bad1bb2442cb8c8a08ccc71ea
6
+ metadata.gz: 6a2ccfd041ef7ff938245ad2e12caf1a950343fa1a97f16f7a243120ac9b440f142a88a132e7fe3b4f847e7eef3b6df698a4f22efb2410cc04481a77996bd45c
7
+ data.tar.gz: b5ae81a9e236b5f9e06270094bf76f12824b513a2195cb4983153838497cc05e1452f57bc7804fba36ac4c8e5298aa2938d63589d5f5113038df59d3a6898dd9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.7.4)
4
+ instant_quote (1.7.5)
5
5
  activesupport
6
6
  capital_on_tap
7
7
  iwoca
@@ -148,4 +148,4 @@ DEPENDENCIES
148
148
  webmock
149
149
 
150
150
  BUNDLED WITH
151
- 2.2.5
151
+ 2.2.11
@@ -18,7 +18,7 @@ module InstantQuote
18
18
  # }
19
19
  class Youlend < DecisionParser
20
20
  def approved?
21
- status_hash[:loanOptions].any? && first_option
21
+ status_hash[:loanOptions].any? && !funded_option.empty?
22
22
  end
23
23
 
24
24
  def declined?
@@ -26,7 +26,7 @@ module InstantQuote
26
26
  end
27
27
 
28
28
  def sweep
29
- first_option[:sweep]
29
+ funded_option[:sweep]
30
30
  end
31
31
 
32
32
  def status
@@ -34,21 +34,19 @@ module InstantQuote
34
34
  end
35
35
 
36
36
  def fee
37
- return 0.0 unless first_option
38
-
39
- fee = first_option[:fee].to_f
37
+ fee = funded_option[:fee].to_f
40
38
 
41
39
  Money.new(fee * 100).format
42
40
  end
43
41
 
44
42
  def loan_amount
45
- amount = first_option[:loanAmount].to_f
43
+ amount = funded_option[:loanAmount].to_f
46
44
 
47
45
  Money.new(amount * 100).format
48
46
  end
49
47
 
50
48
  def funded_amount
51
- amount = first_option[:fundedAmount].to_f
49
+ amount = funded_option[:fundedAmount].to_f
52
50
 
53
51
  Money.new(amount * 100).format
54
52
  end
@@ -57,8 +55,10 @@ module InstantQuote
57
55
 
58
56
  private
59
57
 
60
- def first_option
61
- @first_option ||= status_hash[:loanOptions].find { |opt| opt[:fundedAmount].positive? }
58
+ def funded_option
59
+ @funded_option ||= status_hash[:loanOptions].find(-> { {} }) do |opt|
60
+ opt[:fundedAmount].positive?
61
+ end
62
62
  end
63
63
 
64
64
  def status_hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.7.4'
4
+ VERSION = '1.7.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instant_quote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-20 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -309,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
309
  - !ruby/object:Gem::Version
310
310
  version: '0'
311
311
  requirements: []
312
- rubygems_version: 3.0.3
312
+ rubygems_version: 3.2.11
313
313
  signing_key:
314
314
  specification_version: 4
315
315
  summary: Instant quote providers gem.