Class: PersonalInformationSerializer
- Inherits:
-
Object
- Object
- PersonalInformationSerializer
- Includes:
- JSONAPI::Serializer
- Defined in:
- app/serializers/personal_information_serializer.rb
Instance Method Summary collapse
-
#birth_date ⇒ String
Returns the veteran’s birth date.
-
#gender_identity ⇒ Object
Returns the veteran’s gender identity.
-
#preferred_name ⇒ String
Returns the veteran’s preferred name.
Instance Method Details
#birth_date ⇒ String
Returns the veteran’s birth date. Object is an instance of the MPI::Models::MviProfile class.
17 18 19 |
# File 'app/serializers/personal_information_serializer.rb', line 17 attribute :birth_date do |object| object.demographics&.birth_date&.to_date&.to_s end |
#gender_identity ⇒ Object
Returns the veteran’s gender identity.
33 34 35 36 37 38 39 40 |
# File 'app/serializers/personal_information_serializer.rb', line 33 attribute :gender_identity do |object| return {} if object.demographics&.gender_identity&.nil? { code: object.demographics&.gender_identity&.code, name: object.demographics&.gender_identity&.name } end |
#preferred_name ⇒ String
Returns the veteran’s preferred name.
25 26 27 |
# File 'app/serializers/personal_information_serializer.rb', line 25 attribute :preferred_name do |object| object.demographics&.preferred_name&.text end |