Class: ThePlaidApi::Apr
- Defined in:
- lib/the_plaid_api/models/apr.rb
Overview
Information about the APR on the account.
Instance Attribute Summary collapse
-
#apr_percentage ⇒ Float
Annual Percentage Rate applied.
-
#apr_type ⇒ AprType
The type of balance to which the APR applies.
-
#balance_subject_to_apr ⇒ Float
Amount of money that is subjected to the APR if a balance was carried beyond payment due date.
-
#interest_charge_amount ⇒ Float
Amount of money charged due to interest from last statement.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(apr_percentage:, apr_type:, balance_subject_to_apr:, interest_charge_amount:, additional_properties: nil) ⇒ Apr
constructor
A new instance of Apr.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(apr_percentage:, apr_type:, balance_subject_to_apr:, interest_charge_amount:, additional_properties: nil) ⇒ Apr
Returns a new instance of Apr.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/the_plaid_api/models/apr.rb', line 53 def initialize(apr_percentage:, apr_type:, balance_subject_to_apr:, interest_charge_amount:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @apr_percentage = apr_percentage @apr_type = apr_type @balance_subject_to_apr = balance_subject_to_apr @interest_charge_amount = interest_charge_amount @additional_properties = additional_properties end |
Instance Attribute Details
#apr_percentage ⇒ Float
Annual Percentage Rate applied.
14 15 16 |
# File 'lib/the_plaid_api/models/apr.rb', line 14 def apr_percentage @apr_percentage end |
#apr_type ⇒ AprType
The type of balance to which the APR applies.
18 19 20 |
# File 'lib/the_plaid_api/models/apr.rb', line 18 def apr_type @apr_type end |
#balance_subject_to_apr ⇒ Float
Amount of money that is subjected to the APR if a balance was carried beyond payment due date. How it is calculated can vary by card issuer. It is often calculated as an average daily balance.
24 25 26 |
# File 'lib/the_plaid_api/models/apr.rb', line 24 def balance_subject_to_apr @balance_subject_to_apr end |
#interest_charge_amount ⇒ Float
Amount of money charged due to interest from last statement.
28 29 30 |
# File 'lib/the_plaid_api/models/apr.rb', line 28 def interest_charge_amount @interest_charge_amount end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/the_plaid_api/models/apr.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. apr_percentage = hash.key?('apr_percentage') ? hash['apr_percentage'] : nil apr_type = hash.key?('apr_type') ? hash['apr_type'] : nil balance_subject_to_apr = hash.key?('balance_subject_to_apr') ? hash['balance_subject_to_apr'] : nil interest_charge_amount = hash.key?('interest_charge_amount') ? hash['interest_charge_amount'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Apr.new(apr_percentage: apr_percentage, apr_type: apr_type, balance_subject_to_apr: balance_subject_to_apr, interest_charge_amount: interest_charge_amount, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/the_plaid_api/models/apr.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['apr_percentage'] = 'apr_percentage' @_hash['apr_type'] = 'apr_type' @_hash['balance_subject_to_apr'] = 'balance_subject_to_apr' @_hash['interest_charge_amount'] = 'interest_charge_amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 49 50 51 |
# File 'lib/the_plaid_api/models/apr.rb', line 46 def self.nullables %w[ balance_subject_to_apr interest_charge_amount ] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 |
# File 'lib/the_plaid_api/models/apr.rb', line 41 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/apr.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} apr_percentage: #{@apr_percentage.inspect}, apr_type: #{@apr_type.inspect},"\ " balance_subject_to_apr: #{@balance_subject_to_apr.inspect}, interest_charge_amount:"\ " #{@interest_charge_amount.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 99 |
# File 'lib/the_plaid_api/models/apr.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} apr_percentage: #{@apr_percentage}, apr_type: #{@apr_type},"\ " balance_subject_to_apr: #{@balance_subject_to_apr}, interest_charge_amount:"\ " #{@interest_charge_amount}, additional_properties: #{@additional_properties}>" end |