Class: EducationForm::Forms::VA1990

Inherits:
Base
  • Object
show all
Defined in:
app/sidekiq/education_form/forms/va_1990.rb

Constant Summary collapse

CH33_TYPES =

ERB HELPERS

{
  'chapter1607' => 'CH33_1607', 'chapter1606' => 'CH33_1606', 'chapter30' => 'CH33_30'
}.freeze

Constants inherited from Base

Base::TEMPLATE_PATH

Instance Attribute Summary

Attributes inherited from Base

#form, #record, #text

Instance Method Summary collapse

Methods inherited from Base

#applicant_name, #applicant_ssn, build, #direct_deposit_type, #disclosure_for, #employment_history, #format, #full_address, #full_address_with_street3, #full_name, #get_template, #header, #header_form_type, #hours_and_type, #initialize, #parse_with_template, #parse_with_template_path, #school_name, #school_name_and_addr, #ssn_gender_dob, #to_date, #value_or_na, #yesno, #yesno_or_blank

Constructor Details

This class inherits a constructor from EducationForm::Forms::Base

Instance Method Details

#benefit_type(application) ⇒ Object

If multiple benefit types are selected, we’ve been told to just include whichever one is ‘first’ in the header.



13
14
15
16
17
18
19
20
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 13

def benefit_type(application)
  return 'CH1606' if application.chapter1606
  return 'CH1607' if application.chapter1607
  return 'CH33' if application.chapter33
  return 'CH30' if application.chapter30

  'CH32' if application.chapter32
end

#disclosures(application) ⇒ Object

Some descriptive text that’s included near the top of the 22-1990 form. Because they can make multiple selections, we have to add all the selected ones.



36
37
38
39
40
41
42
43
44
45
46
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 36

def disclosures(application)
  disclosure_texts = []
  disclosure_texts << disclosure_for('CH30') if application.chapter30
  disclosure_texts << disclosure_for('CH1606') if application.chapter1606
  disclosure_texts << disclosure_for('CH32') if application.chapter32
  if application.chapter33
    ch33_type = CH33_TYPES.fetch(application.benefitsRelinquished, 'CH33')
    disclosure_texts << disclosure_for(ch33_type)
  end
  disclosure_texts.join("\n#{'*' * 78}\n\n")
end

#education_typeObject



30
31
32
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 30

def education_type
  @applicant.educationProgram&.educationType
end

#non_va_assistanceObject



22
23
24
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 22

def non_va_assistance
  @applicant.currentlyActiveDuty&.nonVaAssistance
end

#rotc_scholarship_amounts(scholarships) ⇒ Object



48
49
50
51
52
53
54
55
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 48

def rotc_scholarship_amounts(scholarships)
  # there are 5 years, all of which can be blank.
  # Wrap the array to a size of 5 to meet this requirement
  wrapped_list = Array(scholarships)
  Array.new(5) do |idx|
    "            Year #{idx + 1}:          Amount: #{wrapped_list[idx]&.amount}\n"
  end.join("\n")
end

#schoolObject



26
27
28
# File 'app/sidekiq/education_form/forms/va_1990.rb', line 26

def school
  @applicant.educationProgram
end