You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rules.rb
    path of file: ./repos/rack-throttle/lib/rack/throttle
    
    the code of the file until where you have to start completion: require "ipaddr"

module Rack
  module Throttle
    class Rules < TimeWindow
      ##
      # @param  [#call]                  app
      # @param  [Hash{Symbol => Object}] options
      # @opt
    
      def rule_for(request)
        rules.find do |rule|
          next unless rule[:method] == request.request_method.to_s
          next if rule[:proc] && rule[:proc].call(request) == false
          next if rule[:path] && !path_matches?(rule, request.path.to_s)
          rule
        end
      end