Do not allow mutating constants

This commit is contained in:
Gonzalo Rodriguez 2018-01-25 12:22:40 -03:00
parent 6f545e2665
commit 7286517c2f
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,7 @@
module Rack
class Attack
module StoreProxy
PROXIES = [DalliProxy, MemCacheProxy, RedisStoreProxy]
PROXIES = [DalliProxy, MemCacheProxy, RedisStoreProxy].freeze
ACTIVE_SUPPORT_WRAPPER_CLASSES = Set.new(['ActiveSupport::Cache::MemCacheStore', 'ActiveSupport::Cache::RedisStore']).freeze
ACTIVE_SUPPORT_CLIENTS = Set.new(['Redis::Store', 'Dalli::Client', 'MemCache']).freeze

View file

@ -1,7 +1,8 @@
module Rack
class Attack
class Throttle
MANDATORY_OPTIONS = [:limit, :period]
MANDATORY_OPTIONS = [:limit, :period].freeze
attr_reader :name, :limit, :period, :block, :type
def initialize(name, options, block)
@name, @block = name, block