Sha256: 33a867538d0823eac5729c5cda9ab624922604c48081a744a62abba716f2575d
Contents?: true
Size: 617 Bytes
Versions: 4
Compression:
Stored size: 617 Bytes
Contents
module Rack; module Throttle ### # MethodMatchers are used to restrict throttling based on the HTTP # method used by the request. For instance, you may only care about # throttling POST requests on a login form; GET requests are just # fine. # MethodMatchers take Symbol objects of :get, :put, :post, or :delete class MethodMatcher < Matcher ## # @param [Rack::Request] request # @return [Boolean] def match?(request) rack_method = :"#{@rule}?" request.send(rack_method) end ## # @return [String] def identifier "meth-#{@rule}" end end end; end
Version data entries
4 entries across 4 versions & 2 rubygems