Class: EVSS::PCIUAddress::AddressResponse
- Inherits:
-
Response
- Object
- Common::Base
- Response
- EVSS::PCIUAddress::AddressResponse
- Defined in:
- lib/evss/pciu_address/address_response.rb
Overview
Model for PCIU address response
Constant Summary
Constants included from Common::Client::Concerns::ServiceStatus
Common::Client::Concerns::ServiceStatus::RESPONSE_STATUS
Instance Attribute Summary collapse
-
#address ⇒ EVSS::PCIUAddress
The address data returned by the service.
-
#control_information ⇒ Object
@return.
Attributes inherited from Common::Base
Instance Method Summary collapse
-
#initialize(status, response = nil) ⇒ AddressResponse
constructor
A new instance of AddressResponse.
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) ⇒ AddressResponse
Returns a new instance of AddressResponse.
24 25 26 27 28 29 30 31 |
# File 'lib/evss/pciu_address/address_response.rb', line 24 def initialize(status, response = nil) attributes = {} if response attributes[:address] = response.body['cnp_mailing_address'] attributes[:control_information] = response.body['control_information'] end super(status, attributes) end |
Instance Attribute Details
#address ⇒ EVSS::PCIUAddress
Returns The address data returned by the service.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/evss/pciu_address/address_response.rb', line 20 class AddressResponse < EVSS::Response attribute :address, EVSS::PCIUAddress attribute :control_information, EVSS::PCIUAddress::ControlInformation def initialize(status, response = nil) attributes = {} if response attributes[:address] = response.body['cnp_mailing_address'] attributes[:control_information] = response.body['control_information'] end super(status, attributes) end def address=(attrs) super EVSS::PCIUAddress.build_address(attrs) end end |
#control_information ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/evss/pciu_address/address_response.rb', line 20 class AddressResponse < EVSS::Response attribute :address, EVSS::PCIUAddress attribute :control_information, EVSS::PCIUAddress::ControlInformation def initialize(status, response = nil) attributes = {} if response attributes[:address] = response.body['cnp_mailing_address'] attributes[:control_information] = response.body['control_information'] end super(status, attributes) end def address=(attrs) super EVSS::PCIUAddress.build_address(attrs) end end |