Class: ThePlaidApi::PslfStatus

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

Overview

Information about the student’s eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (‘ins_116527`). Since FedLoan no longer services student loans, this field is no longer returned.

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(estimated_eligibility_date:, payments_made:, payments_remaining:, additional_properties: nil) ⇒ PslfStatus

Returns a new instance of PslfStatus.



52
53
54
55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/pslf_status.rb', line 52

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

  @estimated_eligibility_date = estimated_eligibility_date
  @payments_made = payments_made
  @payments_remaining = payments_remaining
  @additional_properties = additional_properties
end

Instance Attribute Details

#estimated_eligibility_dateDate

The estimated date borrower will have completed 120 qualifying monthly payments. Returned in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


19
20
21
# File 'lib/the_plaid_api/models/pslf_status.rb', line 19

def estimated_eligibility_date
  @estimated_eligibility_date
end

#payments_madeInteger

The number of qualifying payments that have been made.

Returns:

  • (Integer)


23
24
25
# File 'lib/the_plaid_api/models/pslf_status.rb', line 23

def payments_made
  @payments_made
end

#payments_remainingInteger

The number of qualifying payments remaining.

Returns:

  • (Integer)


27
28
29
# File 'lib/the_plaid_api/models/pslf_status.rb', line 27

def payments_remaining
  @payments_remaining
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/the_plaid_api/models/pslf_status.rb', line 64

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/pslf_status.rb', line 44

def self.nullables
  %w[
    estimated_eligibility_date
    payments_made
    payments_remaining
  ]
end

.optionalsObject

An array for optional fields



39
40
41
# File 'lib/the_plaid_api/models/pslf_status.rb', line 39

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
94
# File 'lib/the_plaid_api/models/pslf_status.rb', line 89

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