Class: ThePlaidApi::IncomeVerificationPrecheckEmployer

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

Overview

Information about the end user’s employer

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(name: SKIP, address: SKIP, tax_id: SKIP, url: SKIP, additional_properties: nil) ⇒ IncomeVerificationPrecheckEmployer

Returns a new instance of IncomeVerificationPrecheckEmployer.



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

def initialize(name: SKIP, address: SKIP, tax_id: SKIP, url: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @address = address unless address == SKIP
  @tax_id = tax_id unless tax_id == SKIP
  @url = url unless url == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressIncomeVerificationPrecheckEmployerAddress

The address of the employer



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

def address
  @address
end

#nameString

The employer’s name

Returns:

  • (String)


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

def name
  @name
end

#tax_idString

The employer’s tax id

Returns:

  • (String)


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

def tax_id
  @tax_id
end

#urlString

The URL for the employer’s public website

Returns:

  • (String)


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

def url
  @url
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
94
# File 'lib/the_plaid_api/models/income_verification_precheck_employer.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  address = IncomeVerificationPrecheckEmployerAddress.from_hash(hash['address']) if
    hash['address']
  tax_id = hash.key?('tax_id') ? hash['tax_id'] : SKIP
  url = hash.key?('url') ? hash['url'] : 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.
  IncomeVerificationPrecheckEmployer.new(name: name,
                                         address: address,
                                         tax_id: tax_id,
                                         url: url,
                                         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_employer.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['address'] = 'address'
  @_hash['tax_id'] = 'tax_id'
  @_hash['url'] = 'url'
  @_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_employer.rb', line 49

def self.nullables
  %w[
    name
    address
    tax_id
    url
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    name
    address
    tax_id
    url
  ]
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_employer.rb', line 104

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

#to_sObject

Provides a human-readable string representation of the object.



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

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