Class: EmailAssessor::DirectoryDomainList

Inherits:
Object
  • Object
show all
Defined in:
lib/email_assessor/directory_domain_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathnameObject (readonly)

Returns the value of attribute pathname.



5
6
7
# File 'lib/email_assessor/directory_domain_list.rb', line 5

def pathname
  @pathname
end

Instance Method Details

#include_any?(domain_token_set) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
# File 'lib/email_assessor/directory_domain_list.rb', line 7

def include_any?(domain_token_set)
  chars = if @prioritization.present?
    @prioritization
  else
    domain_token_set.indexes
  end

  chars.any? { |char| domain_list(char).include_any?(domain_token_set) }
end

#sampleObject



17
18
19
# File 'lib/email_assessor/directory_domain_list.rb', line 17

def sample
  File.open(Dir.glob(File.join(@pathname, "?.txt")).first, &:readline).chomp
end