Module: Escher::RackMiddleware::ExcludePath::Helper

Defined in:
lib/escher/rack_middleware/exclude_paths/helper.rb

Instance Method Summary collapse

Instance Method Details

#excluded_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
# File 'lib/escher/rack_middleware/exclude_paths/helper.rb', line 7

def excluded_path?(path)
  excluded_paths.any? do |matcher|
    if matcher.is_a?(Regexp)
      !!(path =~ matcher)
    else
      path == matcher.to_s
    end
  end
end

#excluded_pathsObject



3
4
5
# File 'lib/escher/rack_middleware/exclude_paths/helper.rb', line 3

def excluded_paths
  @excluded_paths ||= self.class.excluded_paths.dup
end