Sha256: fa98e636be78eb810899fb10719699c9f759f7e406c631fd4594f0f8254c0026

Contents?: true

Size: 418 Bytes

Versions: 5

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

module EmailAssessor
  class FileDomainList
    attr_reader :pathname

    def include_any?(domain_token_set)
      File.foreach(@pathname, chomp: true).any? do |domain|
        domain_token_set.include?(domain)
      end
    end

    def sample
      File.open(@pathname, &:readline).chomp
    end

    private

    def initialize(pathname)
      @pathname = pathname
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
email_assessor-1.0.4 lib/email_assessor/file_domain_list.rb
email_assessor-1.0.3 lib/email_assessor/file_domain_list.rb
email_assessor-1.0.2 lib/email_assessor/file_domain_list.rb
email_assessor-1.0.1 lib/email_assessor/file_domain_list.rb
email_assessor-1.0.0 lib/email_assessor/file_domain_list.rb