Class: BGSDependents::AdultChildAttendingSchool

Inherits:
Base show all
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

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

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_dateString

Returns the person’s birth date.

Returns:

  • (String)

    the person’s birth date



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

#ever_married_indString

Returns Y/N indicates whether the person has ever been married.

Returns:

  • (String)

    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

#firstString

Returns the person’s first name.

Returns:

  • (String)

    the person’s first name



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

#lastString

Returns the person’s last name.

Returns:

  • (String)

    the person’s last name



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

#middleString

Returns the person’s middle name.

Returns:

  • (String)

    the person’s middle name



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

#ssnString

Returns the person’s social security number.

Returns:

  • (String)

    the person’s social security number



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

#suffixString

Returns the person’s name suffix.

Returns:

  • (String)

    the person’s name suffix



22
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 22

attribute :first, String

Instance Method Details

#addressHash

Sets a hash with the student’s address based on the submitted form information

Returns:

  • (Hash)

    the student’s address



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

#format_infoHash

Sets a hash with AdultChildAttendingSchool attributes

Returns:

  • (Hash)

    AdultChildAttendingSchool attributes including name and address info



49
50
51
# File 'app/models/bgs_dependents/adult_child_attending_school.rb', line 49

def format_info
  attributes.with_indifferent_access
end