Class: ImapMogura::FromMatcher
- Inherits:
-
SpecialFieldMatcher
- Object
- RuleElement
- FieldMatcher
- SpecialFieldMatcher
- ImapMogura::FromMatcher
- Defined in:
- lib/imap_mogura/rules_parser/rule_elements.rb
Instance Attribute Summary
Attributes inherited from FieldMatcher
Instance Method Summary collapse
Methods inherited from FieldMatcher
Constructor Details
This class inherits a constructor from ImapMogura::FieldMatcher
Instance Method Details
#match?(mail) ⇒ Boolean
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/imap_mogura/rules_parser/rule_elements.rb', line 67 def match?(mail) ("From #{mail.from.inspect} matches the regexp #{@regexp}") debug_out_if_it_matches_rule( case mail.from when Enumerable mail.from.any? { |address| address&.match?(@regexp) } else mail.from&.match?(@regexp) end ) end |