Class: Preneeds::Applicant
- Defined in:
- app/models/preneeds/applicant.rb
Overview
Models an Applicant from a BurialForm form
Instance Attribute Summary collapse
-
#applicant_email ⇒ String
Applicant’s email.
-
#applicant_phone_number ⇒ String
Applicant’s phone number.
-
#applicant_relationship_to_claimant ⇒ String
Applicant’s relationship to claimant.
-
#completing_reason ⇒ String
Completing reason.
-
#mailing_address ⇒ Preneeds::Address
Applicant’s mailing address.
-
#name ⇒ Preneeds::FullName
Applicant’s name.
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
permalink #applicant_email ⇒ String
Returns applicant’s email.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
permalink #applicant_phone_number ⇒ String
Returns applicant’s phone number.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
permalink #applicant_relationship_to_claimant ⇒ String
Returns applicant’s relationship to claimant.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
permalink #completing_reason ⇒ String
Returns completing reason. Currently hard coded.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
permalink #mailing_address ⇒ Preneeds::Address
Returns applicant’s mailing address.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
permalink #name ⇒ Preneeds::FullName
Returns applicant’s name.
19 20 21 22 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 |
# File 'app/models/preneeds/applicant.rb', line 19 class Applicant < Preneeds::Base attribute :applicant_email, String attribute :applicant_phone_number, String attribute :applicant_relationship_to_claimant, String attribute :completing_reason, String, default: 'vets.gov application' attribute :mailing_address, Preneeds::Address attribute :name, Preneeds::FullName # (see Preneeds::BurialForm#as_eoas) # def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end # List of permitted params for use with Strong Parameters # # @return [Array] array of class attributes as symbols # def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end end |
Class Method Details
permalink .permitted_params ⇒ Array
List of permitted params for use with Strong Parameters
43 44 45 46 47 48 |
# File 'app/models/preneeds/applicant.rb', line 43 def self.permitted_params [ :applicant_email, :applicant_phone_number, :applicant_relationship_to_claimant, :completing_reason, { mailing_address: Preneeds::Address.permitted_params, name: Preneeds::FullName.permitted_params } ] end |
Instance Method Details
permalink #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
30 31 32 33 34 35 36 37 |
# File 'app/models/preneeds/applicant.rb', line 30 def as_eoas { applicantEmail: applicant_email, applicantPhoneNumber: applicant_phone_number, applicantRelationshipToClaimant: applicant_relationship_to_claimant, completingReason: completing_reason, mailingAddress: mailing_address&.as_eoas, name: name&.as_eoas } end |