Class: Rack::Attack
- Inherits:
-
Object
- Object
- Rack::Attack
- Defined in:
- lib/nexaas/throttle/middleware.rb
Class Method Summary collapse
Class Method Details
.configuration ⇒ Object
6 7 8 |
# File 'lib/nexaas/throttle/middleware.rb', line 6 def self.configuration @configuration ||= Nexaas::Throttle.configuration end |
.guardian(request) ⇒ Object
10 11 12 |
# File 'lib/nexaas/throttle/middleware.rb', line 10 def self.guardian(request) Nexaas::Throttle::Guardian.new(request, configuration) end |
.throttled?(req) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/nexaas/throttle/middleware.rb', line 14 def self.throttled?(req) throttled = throttles.any? do |name, throttle| throttle[req] end throttled && configuration.throttleable? end |