Class: RDig::UrlFilters::PathInclusionFilter

Inherits:
PatternFilter show all
Defined in:
lib/rdig/url_filters.rb

Overview

returns the document if any of the patterns matches it’s path, nil otherwise. Applied to real files only

Instance Method Summary collapse

Methods inherited from PatternFilter

#initialize

Constructor Details

This class inherits a constructor from RDig::UrlFilters::PatternFilter

Instance Method Details

#apply(document) ⇒ Object



148
149
150
151
152
153
154
# File 'lib/rdig/url_filters.rb', line 148

def apply(document)
  return document unless (@patterns && document.file?)
  @patterns.each { |p|
    return document if document.uri.path =~ p
  }
  return nil
end