Class: Acl9::Dsl::Generators::FilterMethod
- Inherits:
-
BaseGenerator
- Object
- Base
- BaseGenerator
- Acl9::Dsl::Generators::FilterMethod
- Defined in:
- lib/acl9/controller_extensions/generators.rb
Direct Known Subclasses
Constant Summary
Constants included from Prepositions
Prepositions::VALID_PREPOSITIONS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(subject_method, method_name) ⇒ FilterMethod
constructor
A new instance of FilterMethod.
- #install_on(controller_class, options) ⇒ Object
Methods inherited from Base
#acl_block!, #allowance_expression, #default_action
Methods included from Prepositions
Constructor Details
#initialize(subject_method, method_name) ⇒ FilterMethod
Returns a new instance of FilterMethod.
86 87 88 89 90 91 |
# File 'lib/acl9/controller_extensions/generators.rb', line 86 def initialize(subject_method, method_name) super @method_name = method_name @controller = nil end |
Instance Method Details
#install_on(controller_class, options) ⇒ Object
93 94 95 96 97 |
# File 'lib/acl9/controller_extensions/generators.rb', line 93 def install_on(controller_class, ) super _add_method(controller_class) controller_class.send(:before_action, @method_name, ) end |