Class: Preneeds::Veteran
Overview
Models a veteran from a BurialForm form
Instance Attribute Summary collapse
-
#address ⇒ Preneeds::Address
Veteran’s address.
-
#current_name ⇒ Preneeds::FullName
Veteran’s current name.
-
#date_of_birth ⇒ String
Veteran’s date of birth.
-
#date_of_death ⇒ String
Veteran’s date of death.
-
#gender ⇒ String
Veteran’s gender.
-
#is_deceased ⇒ String
Is veteran deceased? ‘yes’ or ‘no’.
-
#marital_status ⇒ String
Veteran’s marital status.
-
#military_service_number ⇒ String
Veteran’s military service number.
-
#military_status ⇒ String
Veteran’s military status.
-
#place_of_birth ⇒ String
Veteran’s place of birth.
-
#service_name ⇒ Preneeds::FullName
Veteran’s name when serving.
-
#service_records ⇒ Array<Preneeds::ServiceRecord>
Veteran’s service records.
-
#ssn ⇒ String
Veteran’s social security number.
-
#va_claim_number ⇒ String
Veteran’s VA claim number.
Class Method Summary collapse
-
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters.
Instance Method Summary collapse
-
#as_eoas ⇒ Hash
Converts object attributes to a hash to be used when constructing a SOAP request body.
Methods inherited from Base
Methods included from Vets::Model
#attributes, #initialize, #nested_attributes
Methods included from Vets::Attributes
Instance Attribute Details
#address ⇒ Preneeds::Address
Returns veteran’s address.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#current_name ⇒ Preneeds::FullName
Returns veteran’s current name.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#date_of_birth ⇒ String
Returns veteran’s date of birth.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#date_of_death ⇒ String
Returns veteran’s date of death.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#gender ⇒ String
Returns veteran’s gender.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#is_deceased ⇒ String
Returns is veteran deceased? ‘yes’ or ‘no’.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#marital_status ⇒ String
Returns veteran’s marital status.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#military_service_number ⇒ String
Returns veteran’s military service number.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#military_status ⇒ String
Returns veteran’s military status.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#place_of_birth ⇒ String
Returns veteran’s place of birth.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#service_name ⇒ Preneeds::FullName
Returns veteran’s name when serving.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#service_records ⇒ Array<Preneeds::ServiceRecord>
Returns veteran’s service records.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#ssn ⇒ String
Returns veteran’s social security number.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
#va_claim_number ⇒ String
Returns veteran’s VA claim number.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'app/models/preneeds/veteran.rb', line 35 class Veteran < Preneeds::Base attribute :date_of_birth, String attribute :date_of_death, String attribute :gender, String attribute :is_deceased, String attribute :marital_status, String attribute :military_service_number, String attribute :place_of_birth, String attribute :ssn, String attribute :va_claim_number, String attribute :military_status, String attribute :race, Preneeds::Race attribute :address, Preneeds::Address attribute :current_name, Preneeds::FullName attribute :service_name, Preneeds::FullName attribute :service_records, Preneeds::ServiceRecord, array: true # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end end |
Class Method Details
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters
76 77 78 79 80 81 82 83 84 85 86 |
# File 'app/models/preneeds/veteran.rb', line 76 def self.permitted_params [ :date_of_birth, :date_of_death, :gender, :is_deceased, :marital_status, :military_service_number, :place_of_birth, :ssn, :va_claim_number, :military_status, { race: Preneeds::Race.permitted_params, address: Preneeds::Address.permitted_params, current_name: Preneeds::FullName.permitted_params, service_name: Preneeds::FullName.permitted_params, service_records: [Preneeds::ServiceRecord.permitted_params] } ] end |
Instance Method Details
#as_eoas ⇒ Hash
Converts object attributes to a hash to be used when constructing a SOAP request body. Hash attributes must correspond to XSD ordering or API call will fail
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/models/preneeds/veteran.rb', line 55 def as_eoas hash = { address: address&.as_eoas, currentName: current_name.as_eoas, dateOfBirth: date_of_birth, dateOfDeath: date_of_death, gender:, race: race&.as_eoas, isDeceased: is_deceased, maritalStatus: marital_status, militaryServiceNumber: military_service_number, placeOfBirth: place_of_birth, serviceName: service_name.as_eoas, serviceRecords: service_records.map(&:as_eoas), ssn:, vaClaimNumber: va_claim_number, militaryStatus: military_status } %i[ dateOfBirth dateOfDeath vaClaimNumber placeOfBirth militaryServiceNumber ].each { |key| hash.delete(key) if hash[key].blank? } hash end |