Class: BGS::DisabilityCompensationFormFlashes

Inherits:
Object
  • Object
show all
Defined in:
lib/bgs/disability_compensation_form_flashes.rb

Instance Method Summary collapse

Constructor Details

#initialize(user, form_content) ⇒ DisabilityCompensationFormFlashes

Returns a new instance of DisabilityCompensationFormFlashes.



5
6
7
8
9
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 5

def initialize(user, form_content)
  @user = user
  @form_content = form_content['form526']
  @flashes = []
end

Instance Method Details

#homeless?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 38

def homeless?
  @form_content['homelessOrAtRisk'] == 'homeless'
end

#over_85?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 46

def over_85?
  85.years.ago > @user.birth_date.to_date
end

#pow?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 50

def pow?
  @form_content['confinements'].present?
end

#terminally_ill?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 42

def terminally_ill?
  @form_content['isTerminallyIll'] == true
end

#translateHash

Merges the user data and performs the translation

we’ve started with the flashes that are the most straightforward to determine, but should consider these flashes soon

“Agent Orange - Vietnam”, “Amyotrophic Lateral Sclerosis”, “Blind”, “Blue Water Navy”, “Formerly Homeless”, “GW Undiagnosed Illness”, “Hardship”, “Medal of Honor”, “Purple Heart”, “Seriously Injured/Very Seriously Injured”, “Specially Adapted Housing Claimed”,

Returns:

  • (Hash)

    The translated form(s) ready for submission



30
31
32
33
34
35
36
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 30

def translate
  @flashes << 'Homeless' if homeless?
  @flashes << 'Terminally Ill' if terminally_ill?
  @flashes << 'Priority Processing - Veteran over age 85' if over_85?
  @flashes << 'POW' if pow?
  @flashes
end