Class: Praxis::BootloaderStages::PluginConfigPrepare

Inherits:
Stage
  • Object
show all
Defined in:
lib/praxis/bootloader_stages/plugin_config_prepare.rb

Instance Attribute Summary

Attributes inherited from Stage

#after_callbacks, #before_callbacks, #context, #name, #stages

Instance Method Summary collapse

Methods inherited from Stage

#after, #application, #before, #callback_args, #execute_callbacks, #initialize, #run, #setup!, #setup_deferred_callbacks!

Constructor Details

This class inherits a constructor from Praxis::Stage

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/praxis/bootloader_stages/plugin_config_prepare.rb', line 6

def execute
  application.plugins.each do |config_key, plugin|
    attribute = Attributor::Attribute.new(Attributor::Struct) {}

    plugin.config_attribute = attribute
    plugin.prepare_config!(attribute.type)

    application.config.class.attributes[config_key] = plugin.config_attribute
  end
end