Module: Rack::Attack::StoreProxy
- Defined in:
- lib/rack/attack/store_proxy.rb,
lib/rack/attack/store_proxy/dalli_proxy.rb,
lib/rack/attack/store_proxy/mem_cache_proxy.rb,
lib/rack/attack/store_proxy/redis_store_proxy.rb
Defined Under Namespace
Classes: DalliProxy, MemCacheProxy, RedisStoreProxy
Constant Summary collapse
- PROXIES =
[DalliProxy, MemCacheProxy, RedisStoreProxy]
- ACTIVE_SUPPORT_WRAPPER_CLASSES =
Set.new(['ActiveSupport::Cache::MemCacheStore', 'ActiveSupport::Cache::RedisStore']).freeze
- ACTIVE_SUPPORT_CLIENTS =
Set.new(['Redis::Store', 'Dalli::Client', 'MemCache']).freeze
Class Method Summary collapse
Class Method Details
.build(store) ⇒ Object
9 10 11 12 13 |
# File 'lib/rack/attack/store_proxy.rb', line 9 def self.build(store) client = unwrap_active_support_stores(store) klass = PROXIES.find { |proxy| proxy.handle?(client) } klass ? klass.new(client) : client end |