diff --git a/.rubocop.yml b/.rubocop.yml index ad708a2..e470c08 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -56,5 +56,8 @@ Style/RedundantBegin: Style/RedundantFreeze: Enabled: true +Style/RedundantSelf: + Enabled: true + Style/SingleLineMethods: Enabled: true diff --git a/lib/rack/attack.rb b/lib/rack/attack.rb index d2571a2..4ac4c44 100644 --- a/lib/rack/attack.rb +++ b/lib/rack/attack.rb @@ -33,7 +33,7 @@ class Rack::Attack safelist = Safelist.new(name, block) if name - self.safelists[name] = safelist + safelists[name] = safelist else anonymous_safelists << safelist end @@ -43,7 +43,7 @@ class Rack::Attack blocklist = Blocklist.new(name, block) if name - self.blocklists[name] = blocklist + blocklists[name] = blocklist else anonymous_blocklists << blocklist end @@ -60,11 +60,11 @@ class Rack::Attack end def throttle(name, options, &block) - self.throttles[name] = Throttle.new(name, options, block) + throttles[name] = Throttle.new(name, options, block) end def track(name, options = {}, &block) - self.tracks[name] = Track.new(name, options, block) + tracks[name] = Track.new(name, options, block) end def safelists;