18F/identity-idp

View on GitHub
app/services/usps_in_person_proofing/applicant.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module UspsInPersonProofing
  Applicant = Struct.new(
    :unique_id, :first_name, :last_name, :address, :city, :state, :zip_code,
    :email, keyword_init: true
  ) do
    def has_valid_address?
      (address =~ /[^A-Za-z0-9\-' .\/#]/).nil?
    end
  end
end