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


117
118
119
120
121
122
# File 'lib/acl9/controller_extensions/generators.rb', line 117

def initialize(subject_method, method_name)
  super

  @method_name = method_name
  @controller = nil
end

Instance Method Details

#install_on(controller_class, options) ⇒ Object


124
125
126
127
128
# File 'lib/acl9/controller_extensions/generators.rb', line 124

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