module Roda::RodaPlugins::Base::RequestMethods

def consume(pattern, meth=nil)

path from PATH_INFO, and updates captures with any regex captures.
SCRIPT_NAME to include the matched path, removes the matched
match, returns false without changes. Otherwise, modifies
Attempts to match the pattern to the current path. If there is no
def consume(pattern, meth=nil)
  if matchdata = pattern.match(@remaining_path)
    captures = matchdata.captures
    if meth
      return unless captures = scope.send(meth, *captures)
    # :nocov:
    elsif defined?(yield)
      # RODA4: Remove
      return unless captures = yield(*captures)
    # :nocov:
    end
    @remaining_path = matchdata.post_match
    if captures.is_a?(Array)
      @captures.concat(captures)
    else
      @captures << captures
    end
  end
end