Skip to content

Commit

Permalink
Documented the options for Rack::Throttle::Limiter.new.
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed Mar 21, 2010
1 parent b96ead3 commit 8be3543
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/rack/throttle/interval.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ module Rack; module Throttle
# minimum interval (by default, 1 second) between subsequent allowed HTTP # minimum interval (by default, 1 second) between subsequent allowed HTTP
# requests. # requests.
class Interval < Limiter class Interval < Limiter
##
# @param [#call] app
# @param [Hash{Symbol => Object}] options
# @option options [Float] :min (1.0)
def initialize(app, options = {})
super
end

## ##
# Returns `true` if sufficient time (equal to or more than # Returns `true` if sufficient time (equal to or more than
# {#minimum_interval}) has passed since the last request and the given # {#minimum_interval}) has passed since the last request and the given
Expand Down
8 changes: 6 additions & 2 deletions lib/rack/throttle/limiter.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ class Limiter
attr_reader :options attr_reader :options


## ##
# @param [#call] app # @param [#call] app
# @param [Hash{Symbol => Object}] options # @param [Hash{Symbol => Object}] options
# @option options [String] :cache (Hash.new)
# @option options [String] :key (nil)
# @option options [String] :key_prefix (nil)
# @option options [String] :message ("Rate Limit Exceeded")
def initialize(app, options = {}) def initialize(app, options = {})
@app, @options = app, options @app, @options = app, options
end end
Expand Down

0 comments on commit 8be3543

Please sign in to comment.