Class: Rails::Initializable::Initializer
Relationships & Source Files | |
Inherits: | Object |
Defined in: | railties/lib/rails/initializable.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(name, context, options, &block) ⇒ Initializer
Instance Attribute Details
#block (readonly)
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 12
attr_reader :name, :block
#name (readonly)
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 12
attr_reader :name, :block
Instance Method Details
#after
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 23
def after @options[:after] end
#before
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 19
def before @options[:before] end
#belongs_to?(group) ⇒ Boolean
# File 'railties/lib/rails/initializable.rb', line 27
def belongs_to?(group) @options[:group] == group || @options[:group] == :all end
#bind(context)
[ GitHub ]#context_class
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 40
def context_class @context.class end
#run(*args)
[ GitHub ]# File 'railties/lib/rails/initializable.rb', line 31
def run(*args) @context.instance_exec(*args, &block) end