Class: Rack::Attack::Track

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rack/attack/track.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, block) ⇒ Track

Returns a new instance of Track.



8
9
10
11
12
13
14
15
16
# File 'lib/rack/attack/track.rb', line 8

def initialize(name, options = {}, block)
  options[:type] = :track

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

Instance Attribute Details

#filterObject (readonly)

Returns the value of attribute filter.



6
7
8
# File 'lib/rack/attack/track.rb', line 6

def filter
  @filter
end