summaryrefslogtreecommitdiff
path: root/fake-service/lib/smail/search/negate_match.rb
blob: f8bb59d4e6ceb96b1ca20c3bfc1d3422bb61cb6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Smail
  class Search
    class NegateMatch
      attr_reader :data
      def initialize(data)
        @data = data
      end

      def to_s
        "Negate(#@data)"
      end

      def match?(mail)
        !self.data.match?(mail)
      end

      def match_string?(str)
        !self.data.match_string?(str)
      end
    end
  end
end