Class: VAProfile::Models::PreferredName
- Includes:
- Concerns::Defaultable
- Defined in:
- lib/va_profile/models/preferred_name.rb
Constant Summary
Constants inherited from Base
Class Method Summary collapse
-
.build_from(body) ⇒ VAProfile::Models::PreferredName
Converts a decoded JSON response from VAProfile to an instance of the PreferredName model.
Instance Method Summary collapse
-
#in_json ⇒ String
Converts an instance of the PreferredName model to a JSON encoded string suitable for use in the body of a request to VAProfile.
Methods included from Concerns::Defaultable
Class Method Details
.build_from(body) ⇒ VAProfile::Models::PreferredName
Converts a decoded JSON response from VAProfile to an instance of the PreferredName model
41 42 43 44 45 46 47 |
# File 'lib/va_profile/models/preferred_name.rb', line 41 def self.build_from(body) return nil unless body VAProfile::Models::PreferredName.new( text: body['preferred_name'] ) end |
Instance Method Details
#in_json ⇒ String
Converts an instance of the PreferredName model to a JSON encoded string suitable for use in the body of a request to VAProfile
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/va_profile/models/preferred_name.rb', line 27 def in_json { bio: { preferredName: @text, originatingSourceSystem: SOURCE_SYSTEM, sourceDate: @source_date, sourceSystemUser: @source_system_user } }.to_json end |