Class: EVSS::PCIUAddress::CountriesResponse
- Inherits:
-
Response
- Object
- Common::Base
- Response
- EVSS::PCIUAddress::CountriesResponse
- Defined in:
- lib/evss/pciu_address/countries_response.rb
Overview
Model for countries returned by PCIU
Constant Summary
Constants included from Common::Client::Concerns::ServiceStatus
Common::Client::Concerns::ServiceStatus::RESPONSE_STATUS
Instance Attribute Summary collapse
-
#countries ⇒ Array[String]
An array of country names.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#initialize(status, response = nil) ⇒ CountriesResponse
constructor
A new instance of CountriesResponse.
Methods inherited from Response
#cache?, #metadata, #ok?, #response_status
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(status, response = nil) ⇒ CountriesResponse
Returns a new instance of CountriesResponse.
19 20 21 22 |
# File 'lib/evss/pciu_address/countries_response.rb', line 19 def initialize(status, response = nil) countries = response&.body&.dig('cnp_countries') || response&.body&.dig('countries') super(status, countries:) end |
Instance Attribute Details
#countries ⇒ Array[String]
Returns An array of country names.
16 17 18 19 20 21 22 23 |
# File 'lib/evss/pciu_address/countries_response.rb', line 16 class CountriesResponse < EVSS::Response attribute :countries, Array[String] def initialize(status, response = nil) countries = response&.body&.dig('cnp_countries') || response&.body&.dig('countries') super(status, countries:) end end |