Class: Pluggy::Resources::Loan
- Inherits:
-
APIResource
- Object
- PluggyObject
- APIResource
- Pluggy::Resources::Loan
- Defined in:
- lib/pluggy/resources/loan.rb
Constant Summary
Constants inherited from PluggyObject
PluggyObject::ISO8601, PluggyObject::RESERVED, PluggyObject::TEMPORAL_KEYS
Instance Attribute Summary
Attributes inherited from PluggyObject
Instance Method Summary collapse
- #financing? ⇒ Boolean
-
#item ⇒ Object
Loans hang off an item, not an account.
- #loan? ⇒ Boolean
- #outstanding_balance ⇒ Object
- #overdraft? ⇒ Boolean
- #overdue? ⇒ Boolean
Methods inherited from PluggyObject
#==, #[], #as_json, declared_fields, define_field, #each_pair, fields, #hash, #initialize, #inspect, #key?, #keys, #method_missing, nested, nested_types, #read, #respond_to_missing?, #to_h, #to_json, #values
Constructor Details
This class inherits a constructor from Pluggy::PluggyObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pluggy::PluggyObject
Instance Method Details
#financing? ⇒ Boolean
78 |
# File 'lib/pluggy/resources/loan.rb', line 78 def financing? = self["kind"] == "FINANCING" |
#item ⇒ Object
Loans hang off an item, not an account.
85 |
# File 'lib/pluggy/resources/loan.rb', line 85 def item = ensure_client!.items.retrieve(self["itemId"]) |
#loan? ⇒ Boolean
77 |
# File 'lib/pluggy/resources/loan.rb', line 77 def loan? = self["kind"] == "LOAN" |
#outstanding_balance ⇒ Object
81 |
# File 'lib/pluggy/resources/loan.rb', line 81 def outstanding_balance = payments&.[]("contractOutstandingBalance") |
#overdraft? ⇒ Boolean
79 |
# File 'lib/pluggy/resources/loan.rb', line 79 def overdraft? = self["kind"] == "UNARRANGED_ACCOUNT_OVERDRAFT" |
#overdue? ⇒ Boolean
82 |
# File 'lib/pluggy/resources/loan.rb', line 82 def overdue? = installments&.overdue? || false |