Class: ActionGuard::AllowRule
- Inherits:
-
Object
- Object
- ActionGuard::AllowRule
- Defined in:
- lib/action-guard/rules.rb
Instance Method Summary collapse
- #allows?(person, request_params) ⇒ Boolean
-
#initialize(&block) ⇒ AllowRule
constructor
A new instance of AllowRule.
Constructor Details
#initialize(&block) ⇒ AllowRule
Returns a new instance of AllowRule.
30 31 32 |
# File 'lib/action-guard/rules.rb', line 30 def initialize(&block) @additional_rule = block end |
Instance Method Details
#allows?(person, request_params) ⇒ Boolean
33 34 35 36 |
# File 'lib/action-guard/rules.rb', line 33 def allows?(person, request_params) return @additional_rule.call(person, request_params) unless @additional_rule.nil? true end |