Class: ThePlaidApi::CreditBankEmployment

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/credit_bank_employment.rb

Overview

Detailed information for the bank employment.

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(bank_employment_id:, account_id:, employer:, latest_deposit_date:, earliest_deposit_date:, additional_properties: nil) ⇒ CreditBankEmployment

Returns a new instance of CreditBankEmployment.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 54

def initialize(bank_employment_id:, account_id:, employer:,
               latest_deposit_date:, earliest_deposit_date:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @bank_employment_id = bank_employment_id
  @account_id = 
  @employer = employer
  @latest_deposit_date = latest_deposit_date
  @earliest_deposit_date = earliest_deposit_date
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

Plaid’s unique identifier for the account.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 18

def 
  @account_id
end

#bank_employment_idString

A unique identifier for the bank employment.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 14

def bank_employment_id
  @bank_employment_id
end

#earliest_deposit_dateDate

The date of the earliest deposit from this employer from within the period of the days requested.

Returns:

  • (Date)


31
32
33
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 31

def earliest_deposit_date
  @earliest_deposit_date
end

#employerCreditBankEmployer

Object containing employer data.

Returns:



22
23
24
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 22

def employer
  @employer
end

#latest_deposit_dateDate

The date of the most recent deposit from this employer.

Returns:

  • (Date)


26
27
28
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 26

def latest_deposit_date
  @latest_deposit_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bank_employment_id =
    hash.key?('bank_employment_id') ? hash['bank_employment_id'] : nil
   = hash.key?('account_id') ? hash['account_id'] : nil
  employer = CreditBankEmployer.from_hash(hash['employer']) if hash['employer']
  latest_deposit_date =
    hash.key?('latest_deposit_date') ? hash['latest_deposit_date'] : nil
  earliest_deposit_date =
    hash.key?('earliest_deposit_date') ? hash['earliest_deposit_date'] : 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.
  CreditBankEmployment.new(bank_employment_id: bank_employment_id,
                           account_id: ,
                           employer: employer,
                           latest_deposit_date: latest_deposit_date,
                           earliest_deposit_date: earliest_deposit_date,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bank_employment_id'] = 'bank_employment_id'
  @_hash['account_id'] = 'account_id'
  @_hash['employer'] = 'employer'
  @_hash['latest_deposit_date'] = 'latest_deposit_date'
  @_hash['earliest_deposit_date'] = 'earliest_deposit_date'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 45

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
113
114
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 108

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

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
104
105
# File 'lib/the_plaid_api/models/credit_bank_employment.rb', line 99

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