Class: BGSDependents::AdultChildAttendingSchool
- Inherits:
-
Base
- Object
- Common::Base
- Base
- BGSDependents::AdultChildAttendingSchool
- Defined in:
- app/models/bgs_dependents/adult_child_attending_school.rb
Constant Summary
Constants inherited from Base
Base::MILITARY_POST_OFFICE_TYPE_CODES
Instance Attribute Summary collapse
-
#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.
-
#middle ⇒ String
The person’s middle name.
-
#ssn ⇒ String
The person’s social security number.
-
#suffix ⇒ String
The person’s name suffix.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#address ⇒ Hash
Sets a hash with the student’s address based on the submitted form information.
- #described_class_attribute_hash ⇒ Object private
-
#format_info ⇒ Hash
Sets a hash with AdultChildAttendingSchool attributes.
-
#initialize(dependents_application) ⇒ AdultChildAttendingSchool
constructor
A new instance of AdultChildAttendingSchool.
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) ⇒ AdultChildAttendingSchool
Returns a new instance of AdultChildAttendingSchool.
34 35 36 37 38 39 40 41 42 43 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 34 def initialize(dependents_application) @dependents_application = dependents_application @ssn = @dependents_application.dig('student_name_and_ssn', 'ssn') @full_name = @dependents_application['student_name_and_ssn']['full_name'] @birth_date = @dependents_application.dig('student_name_and_ssn', 'birth_date') @was_married = @dependents_application['student_address_marriage_tuition']['was_married'] @dependent_income = @dependents_application['student_name_and_ssn']['dependent_income'] self.attributes = described_class_attribute_hash end |
Instance Attribute Details
#birth_date ⇒ String
Returns the person’s birth date.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#ever_married_ind ⇒ String
Returns Y/N indicates whether the person has ever been married.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#first ⇒ String
Returns the person’s first name.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#last ⇒ String
Returns the person’s last name.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#middle ⇒ String
Returns the person’s middle name.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#ssn ⇒ String
Returns the person’s social security number.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
#suffix ⇒ String
Returns the person’s name suffix.
22 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22 attribute :first, String |
Instance Method Details
#address ⇒ Hash
Sets a hash with the student’s address based on the submitted form information
57 58 59 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 57 def address @dependents_application['student_address_marriage_tuition']['address'] end |
#described_class_attribute_hash ⇒ Object (private)
63 64 65 66 67 68 69 70 71 72 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 63 def described_class_attribute_hash # we will raise an error here if not #valid? when we merge in exception PR { ssn: @ssn, birth_date: @birth_date, ever_married_ind: formatted_boolean(@was_married), dependent_income: formatted_boolean(@dependent_income) }.merge(@full_name) end |
#format_info ⇒ Hash
Sets a hash with AdultChildAttendingSchool attributes
49 50 51 |
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 49 def format_info attributes.with_indifferent_access end |