Class: BGSDependents::Spouse
- Inherits:
-
Base
- Object
- Common::Base
- Base
- BGSDependents::Spouse
- Defined in:
- app/models/bgs_dependents/spouse.rb
Constant Summary
Constants inherited from Base
Base::MILITARY_POST_OFFICE_TYPE_CODES
Instance Attribute Summary collapse
-
#address ⇒ Hash
The person’s address.
-
#birth_date ⇒ String
The person’s birth date.
-
#ever_married_ind ⇒ String
Y/N indicates whether the person has ever been married.
-
#first ⇒ String
The person’s first name.
-
#last ⇒ String
The person’s last name.
-
#martl_status_type_cd ⇒ String
Marital status type: Married, Divorced, Widowed, Separated, Never Married.
-
#middle ⇒ String
The person’s middle name.
-
#spouse_income ⇒ String
Did this spouse have income in the last 365 days.
-
#ssn ⇒ String
The person’s social security number.
-
#suffix ⇒ String
The person’s name suffix.
-
#va_file_number ⇒ String
The person’s va file number.
-
#vet_ind ⇒ String
Y/N indicates whether the person is a veteran.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#format_info ⇒ Hash
Sets a hash with spouse attributes.
-
#initialize(dependents_application) ⇒ Spouse
constructor
A new instance of Spouse.
- #lives_with_vet ⇒ Object private
- #marital_status ⇒ Object private
- #spouse_address ⇒ Object private
-
#spouse_attributes ⇒ Hash
private
Sets a hash with spouse attributes.
- #spouse_is_veteran ⇒ Object private
Methods inherited from Base
#adjust_address_lines_for!, #adjust_country_name_for!, #create_address_params, #create_person_params, #dependent_address, #format_date, #formatted_boolean, #generate_address, #relationship_type, #serialize_dependent_result
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(dependents_application) ⇒ Spouse
Returns a new instance of Spouse.
45 46 47 48 49 50 |
# File 'app/models/bgs_dependents/spouse.rb', line 45 def initialize(dependents_application) @dependents_application = dependents_application @spouse_information = @dependents_application['spouse_information'] self.attributes = spouse_attributes end |
Instance Attribute Details
#address ⇒ Hash
Returns the person’s address.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#birth_date ⇒ String
Returns the person’s birth date.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#ever_married_ind ⇒ String
Returns Y/N indicates whether the person has ever been married.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#first ⇒ String
Returns the person’s first name.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#last ⇒ String
Returns the person’s last name.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#martl_status_type_cd ⇒ String
Returns marital status type: Married, Divorced, Widowed, Separated, Never Married.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#middle ⇒ String
Returns the person’s middle name.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#spouse_income ⇒ String
Returns did this spouse have income in the last 365 days.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#ssn ⇒ String
Returns the person’s social security number.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#suffix ⇒ String
Returns the person’s name suffix.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#va_file_number ⇒ String
Returns the person’s va file number.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
#vet_ind ⇒ String
Returns Y/N indicates whether the person is a veteran.
32 |
# File 'app/models/bgs_dependents/spouse.rb', line 32 attribute :ssn, String |
Instance Method Details
#format_info ⇒ Hash
Sets a hash with spouse attributes
56 57 58 |
# File 'app/models/bgs_dependents/spouse.rb', line 56 def format_info attributes.with_indifferent_access end |
#lives_with_vet ⇒ Object (private)
81 82 83 |
# File 'app/models/bgs_dependents/spouse.rb', line 81 def lives_with_vet @dependents_application['does_live_with_spouse']['spouse_does_live_with_veteran'] end |
#marital_status ⇒ Object (private)
89 90 91 |
# File 'app/models/bgs_dependents/spouse.rb', line 89 def marital_status lives_with_vet ? 'Married' : 'Separated' end |
#spouse_address ⇒ Object (private)
93 94 95 96 97 98 99 |
# File 'app/models/bgs_dependents/spouse.rb', line 93 def spouse_address dependent_address( dependents_application: @dependents_application, lives_with_vet: @dependents_application['does_live_with_spouse']['spouse_does_live_with_veteran'], alt_address: @dependents_application.dig('does_live_with_spouse', 'address') ) end |
#spouse_attributes ⇒ Hash (private)
Sets a hash with spouse attributes
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'app/models/bgs_dependents/spouse.rb', line 66 def spouse_attributes spouse_info = { ssn: @spouse_information['ssn'], birth_date: @spouse_information['birth_date'], ever_married_ind: 'Y', martl_status_type_cd: marital_status, vet_ind: spouse_is_veteran, address: spouse_address, spouse_income: formatted_boolean(@dependents_application['does_live_with_spouse']['spouse_income']) }.merge(@spouse_information['full_name']) spouse_info.merge!({ va_file_number: @spouse_information['va_file_number'] }) if spouse_is_veteran == 'Y' spouse_info end |
#spouse_is_veteran ⇒ Object (private)
85 86 87 |
# File 'app/models/bgs_dependents/spouse.rb', line 85 def spouse_is_veteran @spouse_information['is_veteran'] ? 'Y' : 'N' end |