instant_quote 1.7.32 → 1.7.33

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: b89114408b133206dcb9136cccad24a21ed90b1b239b2324c233e4d1aff84e3e
4
- data.tar.gz: 55eda56d1077300fc64b3404eabb8fe05b0bd738bbe683bd82ea178bb7e51b5c
3
+ metadata.gz: 961b0814c5895349859b111b9154e56582aade793a7e7623c68e53b142742b86
4
+ data.tar.gz: 7e88f40122d9bc7442618b3fc4aa3994f6b8f988887cfb240de853d47094bd95
5
5
  SHA512:
6
- metadata.gz: 38b94dfd0b8edef75403c5456e42e1b5724d9dd1fbc1c1868d4d21936da662071ee6eb61072c9e649a68ec45e5e766cb639b96e15ee9bcd0355416005969e37c
7
- data.tar.gz: 1c358d5ff8e0eecee9cd108c8a590e44a167631db8d43357eb3ea28a10cd3330aae0d89dfdb30a3e46f1b2b459be17eafbd425ceae88ec28db97bba8bb6058b9
6
+ metadata.gz: ccf3b9a9eb9d9e38c3c9ad2a9341432f683dd0dc6ca14e59b31b80b701563560c4796869f8202a84c45461798387419dbf90b1db943635ad6b513e417b6971f8
7
+ data.tar.gz: aaa6b9dcd4fc6dfebf247e443911af337f77a0cd0f1f713547fc2aa51840e73d6069f68b194b8504ae997598f26c7d9556dff0a665b72457f41d6723629b7947
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instant_quote (1.7.32)
4
+ instant_quote (1.7.33)
5
5
  activesupport
6
6
  capital_on_tap (~> 1.0.1)
7
7
  iwoca (~> 1.1.0)
@@ -165,10 +165,14 @@ module InstantQuote
165
165
  unit = suggested_product.dig(:duration, :unit)
166
166
  amount = suggested_product.dig(:duration, :amount)
167
167
 
168
+ return unless unit && amount
169
+
168
170
  { unit: unit, amount: amount }
169
171
  end
170
172
 
171
173
  def monthly_interest_rate
174
+ return 0 unless first_offer
175
+
172
176
  first_offer[:interest_rate]
173
177
  end
174
178
 
@@ -181,7 +185,7 @@ module InstantQuote
181
185
  private
182
186
 
183
187
  def suggested_product
184
- @status[:requests]&.first&.dig(:suggested_product)
188
+ @status[:requests]&.first&.dig(:suggested_product) || {}
185
189
  end
186
190
 
187
191
  def first_offer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstantQuote
4
- VERSION = '1.7.32'
4
+ VERSION = '1.7.33'
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.32
4
+ version: 1.7.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas