lib/roda/plugins/mail_processor.rb
# Match if any of the given addresses match the given val, which
# can be a string (case insensitive match of the string), array of
# strings (case insensitive match of any string), or regexp
# (normal regexp match).
Match if any of the given addresses match the given val, which
can be a string (case insensitive match of the string), array of
strings (case insensitive match of any string), or regexp
(normal regexp match).
Match if any of the given addresses match the given val which can be a string ( case insensitive match of the string ) array of strings ( case insensitive match of any string ) or regexp ( normal regexp match ) .
def _match_address(field, val, addresses)
          case val
          when String
            addresses.any?{|a| address_match?(a, val)}
          when Array
            overlap = []
            addresses.each do |a|
              val.each do |v|
                if address_match?(a, v)
                  overlap << a 
                end
              end
            end
            unless overlap.empty?
              @captures.concat(overlap)
            end
          when Regexp
            matched = false
            addresses.each do |v|
              if md = val.match(v)
                matched = true
                @captures.concat(md.captures)
              end
            end
            matched
          else
            unsupported_matcher(:field=>val)
          end
        end
def _match_address ( field , val , addresses ) case val when String addresses . any? { | a | address_match? ( a , val ) } when Array overlap = [ ] addresses . each do | a | val . each do | v | if address_match? ( a , v ) overlap << a end end end unless overlap . empty? @captures . concat ( overlap ) end when Regexp matched = false addresses . each do | v | if md = val . match ( v ) matched = true @captures . concat ( md . captures ) end end matched else unsupported_matcher ( :field => val ) end end
Match if any of the given addresses match the given val, which
can be a string (case insensitive match of the string), array of
strings (case insensitive match of any string), or regexp
(normal regexp match).
Match if any of the given addresses match the given val which can be a string ( case insensitive match of the string ) array of strings ( case insensitive match of any string ) or regexp ( normal regexp match ) .
field
val
addresses