Class: HashComparator::Emails::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/hash_comparator/emails/parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(emails, options) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
# File 'lib/hash_comparator/emails/parser.rb', line 8

def initialize(emails, options)
  @emails = emails
  @options = options
end

Instance Attribute Details

#emailsObject

Returns the value of attribute emails.



13
14
15
# File 'lib/hash_comparator/emails/parser.rb', line 13

def emails
  @emails
end

#optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/hash_comparator/emails/parser.rb', line 13

def options
  @options
end

Class Method Details

.parse(emails, options = {}) ⇒ Object



4
5
6
# File 'lib/hash_comparator/emails/parser.rb', line 4

def self.parse(emails, options = {})
  new(emails, options).parse
end

Instance Method Details

#parseObject



15
16
17
18
19
20
# File 'lib/hash_comparator/emails/parser.rb', line 15

def parse
  remove_usernames if options[:remove_usernames]
  remove_generic_domains if options[:remove_generic_domains]

  emails
end