class Sidekiq::WebRoute
def compile
def compile if pattern.match?(NAMED_SEGMENTS_PATTERN) p = pattern.gsub(NAMED_SEGMENTS_PATTERN, '/\1(?<\2>[^$/]+)') Regexp.new("\\A#{p}\\Z") else pattern end end
def initialize(request_method, pattern, block)
def initialize(request_method, pattern, block) @request_method = request_method @pattern = pattern @block = block end
def match(request_method, path)
def match(request_method, path) case matcher when String {} if path == matcher else path_match = path.match(matcher) path_match&.named_captures&.transform_keys(&:to_sym) end end
def matcher
def matcher @matcher ||= compile end