Class: HashComparator::Emails::Analyzer
- Inherits:
-
Object
- Object
- HashComparator::Emails::Analyzer
- Defined in:
- lib/hash_comparator/emails/analyzer.rb
Instance Attribute Summary collapse
-
#hash_function ⇒ Object
Returns the value of attribute hash_function.
-
#options ⇒ Object
Returns the value of attribute options.
-
#subject_hashed_emails ⇒ Object
Returns the value of attribute subject_hashed_emails.
-
#subject_plaintext_emails ⇒ Object
Returns the value of attribute subject_plaintext_emails.
-
#target_hashed_emails ⇒ Object
Returns the value of attribute target_hashed_emails.
Class Method Summary collapse
- .find_common_hashes(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
- .find_common_plaintext(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
- .find_full_results(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
Instance Method Summary collapse
- #find_common_hashes ⇒ Object
- #find_common_plaintext ⇒ Object
- #find_full_results ⇒ Object
-
#initialize(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options:) ⇒ Analyzer
constructor
A new instance of Analyzer.
Constructor Details
#initialize(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options:) ⇒ Analyzer
Returns a new instance of Analyzer.
36 37 38 39 40 41 42 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 36 def initialize(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options:) @hash_function = hash_function @subject_plaintext_emails = subject_plaintext_emails @target_hashed_emails = target_hashed_emails = @subject_hashed_emails = [] end |
Instance Attribute Details
#hash_function ⇒ Object
Returns the value of attribute hash_function.
44 45 46 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 44 def hash_function @hash_function end |
#options ⇒ Object
Returns the value of attribute options.
44 45 46 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 44 def end |
#subject_hashed_emails ⇒ Object
Returns the value of attribute subject_hashed_emails.
44 45 46 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 44 def subject_hashed_emails @subject_hashed_emails end |
#subject_plaintext_emails ⇒ Object
Returns the value of attribute subject_plaintext_emails.
44 45 46 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 44 def subject_plaintext_emails @subject_plaintext_emails end |
#target_hashed_emails ⇒ Object
Returns the value of attribute target_hashed_emails.
44 45 46 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 44 def target_hashed_emails @target_hashed_emails end |
Class Method Details
.find_common_hashes(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 18 def self.find_common_hashes(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) new( hash_function: hash_function, subject_plaintext_emails: subject_plaintext_emails, target_hashed_emails: target_hashed_emails, options: ).find_common_hashes end |
.find_common_plaintext(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 9 def self.find_common_plaintext(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) new( hash_function: hash_function, subject_plaintext_emails: subject_plaintext_emails, target_hashed_emails: target_hashed_emails, options: ).find_common_plaintext end |
.find_full_results(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 27 def self.find_full_results(hash_function:, subject_plaintext_emails:, target_hashed_emails:, options: {}) new( hash_function: hash_function, subject_plaintext_emails: subject_plaintext_emails, target_hashed_emails: target_hashed_emails, options: ).find_full_results end |
Instance Method Details
#find_common_hashes ⇒ Object
51 52 53 54 55 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 51 def find_common_hashes parse hash compare end |
#find_common_plaintext ⇒ Object
46 47 48 49 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 46 def find_common_plaintext common_hashes = find_common_hashes reverse_match(common_hashes) end |
#find_full_results ⇒ Object
57 58 59 60 61 |
# File 'lib/hash_comparator/emails/analyzer.rb', line 57 def find_full_results common_hashed_emails = find_common_hashes common_plaintext_emails = reverse_match(common_hashed_emails) { common_hashed_emails: common_hashed_emails, common_plaintext_emails: common_plaintext_emails } end |