Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Documented the options for Rack::Throttle::Limiter.new.

  • Loading branch information...
commit 8be35432ba027424e91b19f8ff1ba587631cb1a4 1 parent b96ead3
@bendiken bendiken authored
Showing with 14 additions and 2 deletions.
  1. +8 −0 lib/rack/throttle/interval.rb
  2. +6 −2 lib/rack/throttle/limiter.rb
View
8 lib/rack/throttle/interval.rb
@@ -5,6 +5,14 @@ module Rack; module Throttle
# requests.
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
# {#minimum_interval}) has passed since the last request and the given
# present `request`.
View
8 lib/rack/throttle/limiter.rb
@@ -6,8 +6,12 @@ class Limiter
attr_reader :options
##
- # @param [#call] app
- # @param [Hash{Symbol => Object}] options
+ # @param [#call] app
+ # @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 = {})
@app, @options = app, options
end
Please sign in to comment.
Something went wrong with that request. Please try again.