module Protector

Constants

ADAPTERS
VERSION

Gem version

Attributes

config[RW]

Public Class Methods

activate!() click to toggle source
# File lib/protector.rb, line 41
def activate!
  ADAPTERS.each { |adapter| adapter.activate! }
end
insecurely() { || ... } click to toggle source

Allows executing any code having Protector globally disabled

# File lib/protector.rb, line 27
def insecurely(&block)
  Thread.current[:protector_disabled_nesting] ||= 0
  Thread.current[:protector_disabled_nesting] += 1

  Thread.current[:protector_disabled] = true
  yield
ensure
  Thread.current[:protector_disabled_nesting] -= 1

  if Thread.current[:protector_disabled_nesting] == 0
    Thread.current[:protector_disabled] = false
  end
end
paranoid=() click to toggle source
# File lib/protector.rb, line 22
def paranoid=
  '`Protector.paranoid = ...` is deprecated! Please change it to `Protector.config.paranoid = ...`'
end