 
   constructor: ->
     @cache = new CacheStorage
-    @pattern = []
+    @patterns = []
 
     @inPorts =
       in: new noflo.Port

    @outPorts =
      out: new noflo.Port

    @inPorts.pattern.on "data", (pattern) =>
      @pattern = _.map pattern, (p) -> new RegExp(p) if _.isArray(pattern)

    @inPorts.replacement.on "connect", =>
      @cache.connect()

      @outPorts.out.disconnect()

  matchPattern: ->
    groups = @groups.slice(0, @patterns.length)

    for p, i in @patterns
      return false unless groups[i]?.match(p)?

    return true
