Class: ThePlaidApi::TransferBalance
- Defined in:
- lib/the_plaid_api/models/transfer_balance.rb
Overview
Information about the balance held with Plaid.
Instance Attribute Summary collapse
-
#available ⇒ String
The amount of this balance available for use (decimal string with two digits of precision e.g. “10.00”).
-
#current ⇒ String
The available balance, plus amount of pending funds that in processing (decimal string with two digits of precision e.g. “10.00”).
-
#type ⇒ TransferBalanceType
The type of balance.
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(available:, type:, current: SKIP, additional_properties: nil) ⇒ TransferBalance
constructor
A new instance of TransferBalance.
-
#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(available:, type:, current: SKIP, additional_properties: nil) ⇒ TransferBalance
Returns a new instance of TransferBalance.
49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 49 def initialize(available:, type:, current: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @available = available @current = current unless current == SKIP @type = type @additional_properties = additional_properties end |
Instance Attribute Details
#available ⇒ String
The amount of this balance available for use (decimal string with two digits of precision e.g. “10.00”).
15 16 17 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 15 def available @available end |
#current ⇒ String
The available balance, plus amount of pending funds that in processing (decimal string with two digits of precision e.g. “10.00”).
20 21 22 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 20 def current @current end |
#type ⇒ TransferBalanceType
The type of balance. ‘prefunded_rtp_credits` - Your prefunded RTP credit balance with Plaid `prefunded_ach_credits` - Your prefunded ACH credit balance with Plaid
26 27 28 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 26 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. available = hash.key?('available') ? hash['available'] : nil type = hash.key?('type') ? hash['type'] : nil current = hash.key?('current') ? hash['current'] : SKIP # 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. TransferBalance.new(available: available, type: type, current: current, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['available'] = 'available' @_hash['current'] = 'current' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 41 42 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 38 def self.optionals %w[ current ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
90 91 92 93 94 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} available: #{@available.inspect}, current: #{@current.inspect}, type:"\ " #{@type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
83 84 85 86 87 |
# File 'lib/the_plaid_api/models/transfer_balance.rb', line 83 def to_s class_name = self.class.name.split('::').last "<#{class_name} available: #{@available}, current: #{@current}, type: #{@type},"\ " additional_properties: #{@additional_properties}>" end |