Class: Acl9::Dsl::Generators::FilterMethod

Inherits:
BaseGenerator show all
Defined in:
lib/acl9/controller_extensions/generators.rb

Direct Known Subclasses

BooleanMethod

Constant Summary

Constants inherited from Base

Base::VALID_PREPOSITIONS

Instance Attribute Summary

Attributes inherited from Base

#allows, #denys

Instance Method Summary collapse

Methods inherited from Base

#acl_block!, #allowance_expression, #default_action

Constructor Details

#initialize(subject_method, method_name) ⇒ FilterMethod

Returns a new instance of FilterMethod.



87
88
89
90
91
92
# File 'lib/acl9/controller_extensions/generators.rb', line 87

def initialize(subject_method, method_name)
  super

  @method_name = method_name
  @controller = nil
end

Instance Method Details

#install_on(controller_class, options) ⇒ Object



94
95
96
97
98
# File 'lib/acl9/controller_extensions/generators.rb', line 94

def install_on(controller_class, options)
  super
  _add_method(controller_class)
  controller_class.send(:before_filter, @method_name, options)
end