Module: Machined::Initializable

Extended by:
ActiveSupport::Concern
Included in:
Environment
Defined in:
lib/machined/initializable.rb

Overview

Initializable is a minimal version of Rails::Initializable. Its implementation of placing initializers before or after other initializers is a bit naive, compared to the Rails version, but it suits the needs of this lib.

If they move Rails::Initializable into ActiveSupport I’ll remove this module and use theirs. Right now, I don’t want to ‘require ’rails’‘ if I don’t have to.

Defined Under Namespace

Modules: ClassMethods Classes: Initializer

Instance Method Summary collapse

Instance Method Details

#run_initializers(*args) ⇒ Object

Run each initializer with the given args yielded to each initializer’s block.



62
63
64
65
66
67
68
# File 'lib/machined/initializable.rb', line 62

def run_initializers(*args)
  # return if @initializers_run
  self.class.initializers.each do |initializer|
    initializer.run self, *args
  end
  # @initializers_run = true
end