Class: Preneeds::Claimant
Overview
Models an Claimant from a BurialForm form
Instance Attribute Summary collapse
-
#address ⇒ Preneeds::Address
Claimant’s address.
-
#date_of_birth ⇒ String
Claimant date of birth.
-
#desired_cemetery ⇒ String
Cemetery number.
-
#email ⇒ String
Claimant email.
-
#name ⇒ Preneeds::FullName
Claimant’s full name.
-
#phone_number ⇒ String
Claimant phone number.
-
#relationship_to_vet ⇒ String
Code representing claimant’s relationship to servicemember; one of ‘1’, ‘2’, ‘3’, or ‘4’.
-
#ssn ⇒ String
Claimant’s social security 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 claimant’s address.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#date_of_birth ⇒ String
Returns claimant date of birth.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#desired_cemetery ⇒ String
Returns cemetery number.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#email ⇒ String
Returns claimant email.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#name ⇒ Preneeds::FullName
Returns claimant’s full name.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#phone_number ⇒ String
Returns claimant phone number.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#relationship_to_vet ⇒ String
Returns code representing claimant’s relationship to servicemember; one of ‘1’, ‘2’, ‘3’, or ‘4’.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
#ssn ⇒ String
Returns claimant’s social security number.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/preneeds/claimant.rb', line 23 class Claimant < Preneeds::Base attribute :date_of_birth, String attribute :desired_cemetery, String attribute :email, String attribute :phone_number, String attribute :relationship_to_vet, String attribute :ssn, String attribute :name, Preneeds::FullName attribute :address, Preneeds::Address # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
Class Method Details
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters
49 50 51 52 53 54 |
# File 'app/models/preneeds/claimant.rb', line 49 def self.permitted_params [ :date_of_birth, :desired_cemetery, :email, :completing_reason, :phone_number, :relationship_to_vet, :ssn, { address: Preneeds::Address.permitted_params, name: Preneeds::FullName.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
36 37 38 39 40 41 42 43 44 45 |
# File 'app/models/preneeds/claimant.rb', line 36 def as_eoas hash = { address: address&.as_eoas, dateOfBirth: date_of_birth, desiredCemetery: desired_cemetery, email:, name: name&.as_eoas, phoneNumber: phone_number, relationshipToVet: relationship_to_vet, ssn: } %i[email phoneNumber desiredCemetery].each { |key| hash.delete(key) if hash[key].blank? } hash end |