Class: Mailman::Route::BodyCondition

Inherits:
Condition
  • Object
show all
Defined in:
lib/mailman/route/conditions.rb

Overview

Matches against the Body of a message.

Instance Attribute Summary

Attributes inherited from Condition

#matcher

Instance Method Summary collapse

Methods inherited from Condition

inherited, #initialize

Constructor Details

This class inherits a constructor from Mailman::Route::Condition

Instance Method Details

#match(message) ⇒ Object


39
40
41
42
43
44
45
46
47
48
49
# File 'lib/mailman/route/conditions.rb', line 39

def match(message)
  if message.multipart?
    result = nil
    message.parts.each do |part|
      break if result = @matcher.match(part.decoded)
    end
    return result
  else
    @matcher.match(message.body.decoded)
  end
end