Module: Escher::RackMiddleware::IncludePath::Helper

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

Instance Method Summary collapse

Instance Method Details

#included_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#included_pathsObject



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

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