Class: ImapMogura::GeneralFieldMatcher
- Inherits:
-
FieldMatcher
- Object
- RuleElement
- FieldMatcher
- ImapMogura::GeneralFieldMatcher
- Defined in:
- lib/imap_mogura/rules_parser/rule_elements.rb
Instance Attribute Summary
Attributes inherited from FieldMatcher
Instance Method Summary collapse
-
#initialize(field_name, regexp) ⇒ GeneralFieldMatcher
constructor
A new instance of GeneralFieldMatcher.
- #match?(mail) ⇒ Boolean
Constructor Details
#initialize(field_name, regexp) ⇒ GeneralFieldMatcher
Returns a new instance of GeneralFieldMatcher.
130 131 132 133 134 |
# File 'lib/imap_mogura/rules_parser/rule_elements.rb', line 130 def initialize(field_name, regexp) @field_name = field_name super(regexp) end |
Instance Method Details
#match?(mail) ⇒ Boolean
136 137 138 139 |
# File 'lib/imap_mogura/rules_parser/rule_elements.rb', line 136 def match?(mail) ("header field \"#{@field_name}\" with value \"#{mail.headers[@field_name]&.value}\" matches the regexp #{@regexp}") debug_out_if_it_matches_rule(mail.headers[@field_name]&.value&.match?(@regexp)) end |