module Answers::Engine

Public Instance Methods

after_inclusion(&block) click to toggle source

Specify a block of code to be run after the answers inclusion step. See Answers::Core::Engine#answers_inclusion for details regarding the Answers inclusion process.

Example:

module Answers
  module Images
    class Engine < Rails::Engine
      extend Answers::Engine
      engine_name :images

      after_inclusion do
        # perform something here
      end
    end
  end
end
# File lib/answers/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 answers inclusion step. See Answers::Core::Engine#answers_inclusion for details regarding the Answers inclusion process.

Example:

module Answers
  module Images
    class Engine < Rails::Engine
      extend Answers::Engine
      engine_name :images

      before_inclusion do
        # perform something here
      end
    end
  end
end
# File lib/answers/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/answers/engine.rb, line 54
def after_inclusion_procs
  @@after_inclusion_procs ||= []
end
before_inclusion_procs() click to toggle source
# File lib/answers/engine.rb, line 58
def before_inclusion_procs
  @@before_inclusion_procs ||= []
end