Class: EmailAssessor::FileDomainList

Inherits:
Object
  • Object
show all
Defined in:
lib/email_assessor/file_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/file_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
# File 'lib/email_assessor/file_domain_list.rb', line 7

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

#sampleObject



13
14
15
# File 'lib/email_assessor/file_domain_list.rb', line 13

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