Class: Plaid::BankTransferReceiverDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/models/bank_transfer_receiver_details.rb

Overview

The receiver details if the type of this event is ‘reciever_pending` or `reciever_posted`. Null value otherwise.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_balance:, additional_properties: nil) ⇒ BankTransferReceiverDetails

Returns a new instance of BankTransferReceiverDetails.



37
38
39
40
41
42
43
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 37

def initialize(available_balance:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @available_balance = available_balance
  @additional_properties = additional_properties
end

Instance Attribute Details

#available_balanceAvailableBalance

The sign of the available balance for the receiver bank account associated with the receiver event at the time the matching transaction was found. Can be ‘positive`, `negative`, or null if the balance was not available at the time.

Returns:



18
19
20
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 18

def available_balance
  @available_balance
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  available_balance =
    hash.key?('available_balance') ? hash['available_balance'] : 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.
  BankTransferReceiverDetails.new(available_balance: available_balance,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['available_balance'] = 'available_balance'
  @_hash
end

.nullablesObject

An array for nullable fields



33
34
35
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 33

def self.nullables
  []
end

.optionalsObject

An array for optional fields



28
29
30
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 28

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



73
74
75
76
77
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 73

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} available_balance: #{@available_balance.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



66
67
68
69
70
# File 'lib/plaid/models/bank_transfer_receiver_details.rb', line 66

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} available_balance: #{@available_balance}, additional_properties:"\
  " #{@additional_properties}>"
end