Module: Refinery::Engine::ClassMethods

Defined in:
lib/refinery/engine.rb

Instance Method Summary collapse

Instance Method Details

#after_inclusion(&block) ⇒ Object

Specify a block of code to be run after the refinery inclusion step. See Refinery::Core::Engine#refinery_inclusion for details regarding the Refinery inclusion process.

Example:

module Refinery
  module Images
    class Engine < Rails::Engine
      engine_name :images

      after_inclusion do
        # perform something here
      end
    end
  end
end


28
29
30
31
32
33
34
# File 'lib/refinery/engine.rb', line 28

def after_inclusion(&block)
  if block && block.respond_to?(:call)
    after_inclusion_procs << block
  else
    raise 'Anything added to be called after_inclusion must be callable (respond to #call).'
  end
end

#after_inclusion_procsObject

:nodoc:



8
9
10
# File 'lib/refinery/engine.rb', line 8

def after_inclusion_procs #:nodoc:
  @@after_inclusion_procs ||= []
end

#before_inclusion(&block) ⇒ Object

Specify a block of code to be run before the refinery inclusion step. See Refinery::Core::Engine#refinery_inclusion for details regarding the Refinery inclusion process.

Example:

module Refinery
  module Images
    class Engine < Rails::Engine
      engine_name :images

      before_inclusion do
        # perform something here
      end
    end
  end
end


56
57
58
59
60
61
62
# File 'lib/refinery/engine.rb', line 56

def before_inclusion(&block)
  if block && block.respond_to?(:call)
    before_inclusion_procs << block
  else
    raise 'Anything added to be called before_inclusion must be callable (respond to #call).'
  end
end

#before_inclusion_procsObject

:nodoc:



36
37
38
# File 'lib/refinery/engine.rb', line 36

def before_inclusion_procs #:nodoc:
  @@before_inclusion_procs ||= []
end