Module: ParamProtected::ControllerModifications::ClassMethods

Defined in:
lib/param_protected/controller_modifications.rb

Instance Method Summary collapse

Instance Method Details

#_protectorObject



10
11
12
# File 'lib/param_protected/controller_modifications.rb', line 10

def _protector
  @_protector ||= Protector.new
end

#_protector=(value) ⇒ Object



14
15
16
# File 'lib/param_protected/controller_modifications.rb', line 14

def _protector=(value)
  @_protector = value
end

#inherited(m) ⇒ Object



26
27
28
29
# File 'lib/param_protected/controller_modifications.rb', line 26

def inherited(m)
  m._protector = _protector.dup
  super
end

#param_accessible(params, actions = nil) ⇒ Object



22
23
24
# File 'lib/param_protected/controller_modifications.rb', line 22

def param_accessible(params, actions = nil)
  _protector.declare_protection(params, actions, WHITELIST)
end

#param_protected(params, actions = nil) ⇒ Object



18
19
20
# File 'lib/param_protected/controller_modifications.rb', line 18

def param_protected(params, actions = nil)
  _protector.declare_protection(params, actions, BLACKLIST)
end