class RequestInterceptor::ApplicationWrapper

Attributes

pattern[R]

Public Class Methods

new(pattern, application) click to toggle source
Calls superclass method
# File lib/request_interceptor.rb, line 14
def initialize(pattern, application)
  @pattern =
    case pattern
    when String
      %r{://#{Regexp.escape(pattern)}/}
    else
      pattern
    end

  super(application)
end

Public Instance Methods

intercepts?(uri) click to toggle source
# File lib/request_interceptor.rb, line 26
def intercepts?(uri)
  !!pattern.match(uri.normalize.to_s)
end