Class: ThePlaidApi::IncomeVerificationPrecheckUser

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

Overview

Information about the user whose eligibility is being evaluated.

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(first_name: SKIP, last_name: SKIP, email_address: SKIP, home_address: SKIP, additional_properties: nil) ⇒ IncomeVerificationPrecheckUser

Returns a new instance of IncomeVerificationPrecheckUser.



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 58

def initialize(first_name: SKIP, last_name: SKIP, email_address: SKIP,
               home_address: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @first_name = first_name unless first_name == SKIP
  @last_name = last_name unless last_name == SKIP
  @email_address = email_address unless email_address == SKIP
  @home_address = home_address unless home_address == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#email_addressString

The user’s email address

Returns:

  • (String)


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

def email_address
  @email_address
end

#first_nameString

The user’s first name

Returns:

  • (String)


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

def first_name
  @first_name
end

#home_addressAddressData2

Data about the components comprising an address.

Returns:



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

def home_address
  @home_address
end

#last_nameString

The user’s last name

Returns:

  • (String)


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

def last_name
  @last_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  first_name = hash.key?('first_name') ? hash['first_name'] : SKIP
  last_name = hash.key?('last_name') ? hash['last_name'] : SKIP
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  home_address = AddressData2.from_hash(hash['home_address']) if hash['home_address']

  # 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.
  IncomeVerificationPrecheckUser.new(first_name: first_name,
                                     last_name: last_name,
                                     email_address: email_address,
                                     home_address: home_address,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['first_name'] = 'first_name'
  @_hash['last_name'] = 'last_name'
  @_hash['email_address'] = 'email_address'
  @_hash['home_address'] = 'home_address'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
52
53
54
55
56
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 49

def self.nullables
  %w[
    first_name
    last_name
    email_address
    home_address
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 39

def self.optionals
  %w[
    first_name
    last_name
    email_address
    home_address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



104
105
106
107
108
109
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 104

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

#to_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
101
# File 'lib/the_plaid_api/models/income_verification_precheck_user.rb', line 96

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