Rails::Initializable::Initializer Ruby on Rails 5.1.2 Class Rails::Initializable::Initializer < Object railties/lib/rails/initializable.rb Methods A after B before, belongs_to?, bind C context_class N new R run Attributes [R] block [R] name Class Public methods new(name, context, options, &block) Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 12 def initialize(name, context, options, &block) options[:group] ||= :default @name, @context, @options, @block = name, context, options, block end Instance Public methods after() Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 21 def after @options[:after] end before() Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 17 def before @options[:before] end belongs_to?(group) Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 25 def belongs_to?(group) @options[:group] == group || @options[:group] == :all end bind(context) Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 33 def bind(context) return self if @context Initializer.new(@name, context, @options, &block) end context_class() Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 38 def context_class @context.class end run(*args) Link Source: show | on GitHub # File railties/lib/rails/initializable.rb, line 29 def run(*args) @context.instance_exec(*args, &block) end