Module: RequestMeter
- Defined in:
- lib/request_meter/middleware.rb,
lib/request_meter.rb,
lib/request_meter/version.rb,
lib/request_meter/configuration.rb
Overview
RequestMeter::Middleware is a Rack middleware for API rate limiting.
It checks for a configured API key header and limits requests per key using Redis.
Defined Under Namespace
Classes: Configuration, Middleware, MissingCacheClientError
Constant Summary collapse
- VERSION =
Current version of the RequestMeter gem.
"0.1.3"
Class Attribute Summary collapse
-
.configuration ⇒ RequestMeter::Configuration
Current configuration instance.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ void
Configure the RequestMeter settings.
Class Attribute Details
.configuration ⇒ RequestMeter::Configuration
Returns current configuration instance.
12 13 14 |
# File 'lib/request_meter.rb', line 12 def configuration @configuration end |
Class Method Details
.configure {|config| ... } ⇒ void
This method returns an undefined value.
Configure the RequestMeter settings.
Yields the configuration object to the given block.
27 28 29 30 |
# File 'lib/request_meter.rb', line 27 def self.configure self.configuration ||= Configuration.new yield(configuration) end |