Module: ActiveHelper::GenericMethods
- Included in:
- ActiveHelper, Base, ClassMethods
- Defined in:
- lib/active_helper.rb
Instance Method Summary collapse
Instance Method Details
#use_for(classes, target) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/active_helper.rb', line 9 def use_for(classes, target) classes.each do |helper_class| helper_ivar_name = ivar_name_for(helper_class) helper_instance = helper_class.new(target) instance_variable_set(helper_ivar_name, helper_instance) delegate_methods_to(helper_class.helper_methods, helper_ivar_name) end end |