Class: NestedModelAuth::AuthorizationRule
- Inherits:
-
Object
- Object
- NestedModelAuth::AuthorizationRule
- Defined in:
- lib/nested_model_auth.rb
Instance Attribute Summary collapse
-
#auth_action ⇒ Object
Returns the value of attribute auth_action.
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize(auth_action, &block) ⇒ AuthorizationRule
constructor
A new instance of AuthorizationRule.
- #invoke_for(model, resource) ⇒ Object
Constructor Details
#initialize(auth_action, &block) ⇒ AuthorizationRule
Returns a new instance of AuthorizationRule.
9 10 11 12 |
# File 'lib/nested_model_auth.rb', line 9 def initialize(auth_action, &block) @auth_action = auth_action @block = block end |
Instance Attribute Details
#auth_action ⇒ Object
Returns the value of attribute auth_action.
7 8 9 |
# File 'lib/nested_model_auth.rb', line 7 def auth_action @auth_action end |
#block ⇒ Object
Returns the value of attribute block.
7 8 9 |
# File 'lib/nested_model_auth.rb', line 7 def block @block end |
Instance Method Details
#invoke_for(model, resource) ⇒ Object
14 15 16 |
# File 'lib/nested_model_auth.rb', line 14 def invoke_for(model, resource) model.instance_exec(resource, &@block) end |