Class: ThePlaidApi::IncomeVerificationPrecheckMilitaryInfo

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

Overview

Data about military info in the income verification precheck.

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(is_active_duty: SKIP, branch: SKIP, additional_properties: nil) ⇒ IncomeVerificationPrecheckMilitaryInfo

Returns a new instance of IncomeVerificationPrecheckMilitaryInfo.



47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 47

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

  @is_active_duty = is_active_duty unless is_active_duty == SKIP
  @branch = branch unless branch == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#branchString

If the user is currently serving in the US military, the branch of the military in which they are serving Valid values: ‘AIR FORCE’, ‘ARMY’, ‘COAST GUARD’, ‘MARINES’, ‘NAVY’, ‘UNKNOWN’

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 21

def branch
  @branch
end

#is_active_dutyTrueClass | FalseClass

Is the user currently active duty in the US military

Returns:

  • (TrueClass | FalseClass)


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

def is_active_duty
  @is_active_duty
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 58

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 24

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    is_active_duty
    branch
  ]
end

.optionalsObject

An array for optional fields



32
33
34
35
36
37
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 32

def self.optionals
  %w[
    is_active_duty
    branch
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 87

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

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/the_plaid_api/models/income_verification_precheck_military_info.rb', line 80

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