Class: VAProfile::Demographics::PreferredNameResponse

Inherits:
Response show all
Defined in:
lib/va_profile/demographics/preferred_name_response.rb

Constant Summary

Constants included from Common::Client::Concerns::ServiceStatus

Common::Client::Concerns::ServiceStatus::RESPONSE_STATUS

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Response

#cache?, #initialize, #metadata, #ok?, #response_status

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from VAProfile::Response

Class Method Details

.from(raw_response = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/va_profile/demographics/preferred_name_response.rb', line 15

def self.from(raw_response = nil)
  response_body = raw_response&.body

  new(
    raw_response&.status,
    preferred_name: VAProfile::Models::PreferredName.build_from(response_body)
  )
end

Instance Method Details

#textObject



11
12
13
# File 'lib/va_profile/demographics/preferred_name_response.rb', line 11

def text
  preferred_name&.text
end