Class: InstantQuote::DecisionParsers::CapitalOnTap
- Inherits:
-
InstantQuote::DecisionParser
- Object
- InstantQuote::DecisionParser
- InstantQuote::DecisionParsers::CapitalOnTap
- Defined in:
- lib/instant_quote/decision_parsers/capital_on_tap.rb
Constant Summary collapse
- STATUSES =
{ pending: 'Pending', approved: 'Approved', declined: 'Declined', could_not_submit: 'CouldNotSubmit' # this is our own status }.freeze
Instance Attribute Summary
Attributes inherited from InstantQuote::DecisionParser
Instance Method Summary collapse
- #amount ⇒ Object
- #approved? ⇒ Boolean
- #declined? ⇒ Boolean
-
#initialize(data = {}) ⇒ CapitalOnTap
constructor
A new instance of CapitalOnTap.
- #monthly_card_interest_rate ⇒ Object
- #monthly_interest_rate ⇒ Object
- #pending? ⇒ Boolean
-
#stage ⇒ Object
The applicationStage can be one of the following:.
- #status ⇒ Object
Methods inherited from InstantQuote::DecisionParser
#loan_started?, #manual_review?, #no_decision_possible?
Constructor Details
#initialize(data = {}) ⇒ CapitalOnTap
Returns a new instance of CapitalOnTap.
15 16 17 18 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 15 def initialize(data = {}) @data = super @data.delete(:metaData) # remove useless information end |
Instance Method Details
#amount ⇒ Object
32 33 34 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 32 def amount Money.new(credit_decision[:approvalAmount].to_f * 100).format end |
#approved? ⇒ Boolean
24 25 26 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 24 def approved? status == STATUSES[:approved] end |
#declined? ⇒ Boolean
28 29 30 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 28 def declined? status == STATUSES[:declined] end |
#monthly_card_interest_rate ⇒ Object
40 41 42 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 40 def monthly_card_interest_rate credit_decision[:monthlyCardInterestRate] || 0.0 end |
#monthly_interest_rate ⇒ Object
36 37 38 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 36 def monthly_interest_rate credit_decision[:monthlyInterestRate] || 0.0 end |
#pending? ⇒ Boolean
20 21 22 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 20 def pending? status == STATUSES[:pending] end |
#stage ⇒ Object
The applicationStage can be one of the following:
Undetermined, AppSubmitted, Referred, KybSoleTrader, KybPartner, IncompleteInfo, FinancialsOverdue, Declined, Duplicate, IdVerificationRequired, ReferredAfterUpdate, ApprovedCredit, ApprovedPrepaid, DdSetup, AddOnSelection, DoneHavFailed, DoneIdVerificationRequired, Done, Portal
54 55 56 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 54 def stage data[:applicationStage] || {} end |
#status ⇒ Object
44 45 46 |
# File 'lib/instant_quote/decision_parsers/capital_on_tap.rb', line 44 def status credit_decision[:status] || STATUSES[:could_not_submit] end |