class Rack::Attack::Track

Attributes

filter[R]

Public Class Methods

new(name, options = {}, &block) click to toggle source
# File lib/rack/attack/track.rb, line 8
def initialize(name, options = {}, &block)
  options[:type] = :track

  @filter =
    if options[:limit] && options[:period]
      Throttle.new(name, options, &block)
    else
      Check.new(name, options, &block)
    end
end

Public Instance Methods

matched_by?(request) click to toggle source
# File lib/rack/attack/track.rb, line 19
def matched_by?(request)
  filter.matched_by?(request)
end