Sha256: 3b989af4179b553c996abe1db0b0c98fd5baeb88ab25f42bd50ecf8f1f157be0

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

module Validators
  class DisposableEmails
    def self.all
      @all ||=
        begin
          Validators.require_dependency! "root_domain"
          Validators.require_dependency! "email_data"
          EmailData.disposable_emails
        end
    end

    def self.include?(email)
      mailbox, domain = email.to_s.split("@")
      mailbox = mailbox.to_s.delete(".")
      mailbox = mailbox.gsub(/\+(.+)?\Z/, "")

      all.include?("#{mailbox}@#{domain}")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validators-3.4.2 lib/validators/disposable_emails.rb