Class: Rack::Attack::BaseProxy

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/rack/attack/base_proxy.rb

Class Method Summary collapse

Class Method Details

.handle?(_store) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/rack/attack/base_proxy.rb', line 21

def handle?(_store)
  raise NotImplementedError
end

.inherited(klass) ⇒ Object



13
14
15
# File 'lib/rack/attack/base_proxy.rb', line 13

def inherited(klass)
  proxies << klass
end

.lookup(store) ⇒ Object



17
18
19
# File 'lib/rack/attack/base_proxy.rb', line 17

def lookup(store)
  proxies.find { |proxy| proxy.handle?(store) }
end

.proxiesObject



9
10
11
# File 'lib/rack/attack/base_proxy.rb', line 9

def proxies
  @@proxies ||= []
end