Class: Preneeds::FullName
Overview
Models a full name for persons included in a BurialForm form
Instance Attribute Summary collapse
-
#first ⇒ String
First name.
-
#last ⇒ String
Last name.
-
#maiden ⇒ String
Maiden name.
-
#middle ⇒ String
Middle name.
-
#suffix ⇒ String
Name suffix.
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
#first ⇒ String
Returns first name.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/full_name.rb', line 17 class FullName < Preneeds::Base attribute :first, String attribute :last, String attribute :maiden, String attribute :middle, String attribute :suffix, String # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[first last maiden middle suffix] end end |
#last ⇒ String
Returns last name.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/full_name.rb', line 17 class FullName < Preneeds::Base attribute :first, String attribute :last, String attribute :maiden, String attribute :middle, String attribute :suffix, String # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[first last maiden middle suffix] end end |
#maiden ⇒ String
Returns maiden name.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/full_name.rb', line 17 class FullName < Preneeds::Base attribute :first, String attribute :last, String attribute :maiden, String attribute :middle, String attribute :suffix, String # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[first last maiden middle suffix] end end |
#middle ⇒ String
Returns middle name.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/full_name.rb', line 17 class FullName < Preneeds::Base attribute :first, String attribute :last, String attribute :maiden, String attribute :middle, String attribute :suffix, String # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[first last maiden middle suffix] end end |
#suffix ⇒ String
Returns name suffix.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/models/preneeds/full_name.rb', line 17 class FullName < Preneeds::Base attribute :first, String attribute :last, String attribute :maiden, String attribute :middle, String attribute :suffix, String # (see Preneeds::BurialForm#as_eoas) # def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end # (see Preneeds::Applicant.permitted_params) # def self.permitted_params %i[first last maiden middle suffix] end end |
Class Method Details
.permitted_params ⇒ Array
List of permitted params for use with Strong Parameters
38 39 40 |
# File 'app/models/preneeds/full_name.rb', line 38 def self.permitted_params %i[first last maiden middle suffix] 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
26 27 28 29 30 31 32 33 34 |
# File 'app/models/preneeds/full_name.rb', line 26 def as_eoas hash = { firstName: first, lastName: last, maidenName: maiden, middleName: middle, suffix: } %i[maidenName middleName suffix].each { |key| hash.delete(key) if hash[key].blank? } hash end |