Module: ActiveHelper

Includes:
GenericMethods
Included in:
ActionView::Base
Defined in:
lib/active_helper.rb,
lib/active_helper/base.rb

Defined Under Namespace

Modules: ClassMethods, GenericMethods Classes: Base

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GenericMethods

#use_for

Class Method Details

.included(base) ⇒ Object



76
77
78
# File 'lib/active_helper.rb', line 76

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#import(*classes) ⇒ Object Also known as: use

Imports the provided methods from classes into the target instance (the receiver). All new methods in the target will be delegated back to the helpers.

Note: Imports only into the helped instance itself, not the class.

Example:

class View
end

view = View.new
view.use UrlHelper, DataMapperHelper


49
50
51
52
# File 'lib/active_helper.rb', line 49

def import(*classes)
  setup_delegator_strategy!
  use_for(classes, self)
end