instant_quote 1.7.2 → 1.7.3

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: fd282d49087da4618690e4ce31b277d7ef3ebacb9c1ee08e7140f6e36b068dbe
4
- data.tar.gz: fa1f1c9fd0a4ca9f89ae4f2a97b9d121b9be2988e7802fd02e4fb084d56a4052
3
+ metadata.gz: f9a1202f635271c79343dd62421fb3b5e25c070fb6c9946e4a6b576a7924edc3
4
+ data.tar.gz: 39d9952984651ed93a4fed738be8bafbebe0529a3c271eaa349a8c744eae30de
5
5
  SHA512:
6
- metadata.gz: f6eaccc382934116cf76da77089286a4ffc0b24d64592000828c2668fe5eaa9286a6f2a5b49ddad2f258c0b9de97d352ff6073990293b12be9592bf1108f5cab
7
- data.tar.gz: 68b0407dee94857c6e1da32819dbafcffbd3a0ea278a58b1cb54d1ef4e1b75024deaf81914cb2bd4254c25477f63e5f6ce929e5d3d586dc2da77b93fd9a35f9d
6
+ metadata.gz: a637cffbc3e704ea920c76bc8ef4a0beccfde26dee3380537f4e19aee9df8c385e90db683d950f1e82751622a13e6bb98eb742614299e9a6e6f8ae079b694aae
7
+ data.tar.gz: 6db6c7751b03f95e2ff1045e5cf8c309490d9d169fd472cb665b6a549659b19e4f59e1981f8ff1be2469b67108698ec240ff1241db977cd02ed8c59daa15063d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.7.2)
4
+ instant_quote (1.7.3)
5
5
  activesupport
6
6
  capital_on_tap
7
7
  iwoca
@@ -18,18 +18,24 @@ module InstantQuote
18
18
  # }
19
19
  class Youlend < DecisionParser
20
20
  def approved?
21
- status_hash[:loanOptions].any?
21
+ status_hash[:loanOptions].any? && first_option
22
22
  end
23
23
 
24
24
  def declined?
25
- status_hash[:loanOptions].empty?
25
+ !approved?
26
26
  end
27
27
 
28
28
  def sweep
29
29
  first_option[:sweep]
30
30
  end
31
31
 
32
+ def status
33
+ approved? ? 'approved' : 'declined'
34
+ end
35
+
32
36
  def fee
37
+ return 0.0 unless first_option
38
+
33
39
  fee = first_option[:fee].to_f
34
40
 
35
41
  Money.new(fee * 100).format
@@ -47,6 +53,8 @@ module InstantQuote
47
53
  Money.new(amount * 100).format
48
54
  end
49
55
 
56
+ alias amount funded_amount
57
+
50
58
  private
51
59
 
52
60
  def first_option
@@ -54,7 +62,11 @@ module InstantQuote
54
62
  end
55
63
 
56
64
  def status_hash
57
- data.presence || { loanOptions: [] }
65
+ default = { loanOptions: [] }
66
+
67
+ return default unless data && !data.empty?
68
+
69
+ data
58
70
  end
59
71
  end
60
72
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.7.2'
4
+ VERSION = '1.7.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instant_quote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: 1.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas