class Rack::Attack

Public Class Methods

configuration() click to toggle source
# File lib/nexaas/throttle/middleware.rb, line 6
def self.configuration
  @configuration ||= Nexaas::Throttle.configuration
end
guardian(request) click to toggle source
# File lib/nexaas/throttle/middleware.rb, line 10
def self.guardian(request)
  Nexaas::Throttle::Guardian.new(request, configuration)
end
throttled?(req) click to toggle source
# 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