Class: BGS::DisabilityCompensationFormFlashes
- Inherits:
-
Object
- Object
- BGS::DisabilityCompensationFormFlashes
- Defined in:
- lib/bgs/disability_compensation_form_flashes.rb
Instance Method Summary collapse
- #homeless? ⇒ Boolean
-
#initialize(user, form_content) ⇒ DisabilityCompensationFormFlashes
constructor
A new instance of DisabilityCompensationFormFlashes.
- #over_85? ⇒ Boolean
- #pow? ⇒ Boolean
- #terminally_ill? ⇒ Boolean
-
#translate ⇒ Hash
Merges the user data and performs the translation.
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
38 39 40 |
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 38 def homeless? @form_content['homelessOrAtRisk'] == 'homeless' end |
#over_85? ⇒ 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
50 51 52 |
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 50 def pow? @form_content['confinements'].present? end |
#terminally_ill? ⇒ Boolean
42 43 44 |
# File 'lib/bgs/disability_compensation_form_flashes.rb', line 42 def terminally_ill? @form_content['isTerminallyIll'] == true end |
#translate ⇒ Hash
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”,
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 |