Class: VAProfile::Demographics::GenderIdentityResponse

Inherits:
Response show all
Defined in:
lib/va_profile/demographics/gender_identity_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



19
20
21
22
23
24
25
26
# File 'lib/va_profile/demographics/gender_identity_response.rb', line 19

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

  new(
    raw_response&.status,
    gender_identity: VAProfile::Models::GenderIdentity.build_from(response_body)
  )
end

Instance Method Details

#codeObject



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

def code
  gender_identity&.code
end

#nameObject



15
16
17
# File 'lib/va_profile/demographics/gender_identity_response.rb', line 15

def name
  gender_identity&.name
end