module Refinery::Engine

Public Instance Methods

after_inclusion(&block) click to toggle source

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
      extend Refinery::Engine
      engine_name :images

      after_inclusion do
        # perform something here
      end
    end
  end
end
# File lib/refinery/engine.rb, line 20
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
before_inclusion(&block) click to toggle source

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
      extend Refinery::Engine
      engine_name :images

      before_inclusion do
        # perform something here
      end
    end
  end
end
# File lib/refinery/engine.rb, line 45
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

Private Instance Methods

after_inclusion_procs() click to toggle source
# File lib/refinery/engine.rb, line 54
def after_inclusion_procs
  @@after_inclusion_procs ||= []
end
before_inclusion_procs() click to toggle source
# File lib/refinery/engine.rb, line 58
def before_inclusion_procs
  @@before_inclusion_procs ||= []
end