Class: EVSS::PCIU::EmailAddressResponse

Inherits:
Response show all
Defined in:
lib/evss/pciu/email_address_response.rb

Overview

Model for PCIU email address response

Constant Summary

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

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

Instance Attribute Summary collapse

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

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) ⇒ EmailAddressResponse

Returns a new instance of EmailAddressResponse.



22
23
24
25
26
27
28
29
# File 'lib/evss/pciu/email_address_response.rb', line 22

def initialize(status, response = nil)
  attributes = {
    email: response&.body&.dig('cnp_email_address', 'value'),
    effective_at: response&.body&.dig('cnp_email_address', 'effective_date')
  }

  super(status, attributes)
end

Instance Attribute Details

#effective_atString

Returns Date the email address was known to be valid.

Returns:

  • (String)

    Date the email address was known to be valid



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/evss/pciu/email_address_response.rb', line 18

class EmailAddressResponse < EVSS::Response
  attribute :email, String
  attribute :effective_at, String

  def initialize(status, response = nil)
    attributes = {
      email: response&.body&.dig('cnp_email_address', 'value'),
      effective_at: response&.body&.dig('cnp_email_address', 'effective_date')
    }

    super(status, attributes)
  end
end

#emailString

Returns Email address returned by the service.

Returns:

  • (String)

    Email address returned by the service



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/evss/pciu/email_address_response.rb', line 18

class EmailAddressResponse < EVSS::Response
  attribute :email, String
  attribute :effective_at, String

  def initialize(status, response = nil)
    attributes = {
      email: response&.body&.dig('cnp_email_address', 'value'),
      effective_at: response&.body&.dig('cnp_email_address', 'effective_date')
    }

    super(status, attributes)
  end
end