Class: Ixtlan::Core::Configuration::Manager
- Inherits:
-
Object
- Object
- Ixtlan::Core::Configuration::Manager
- Defined in:
- lib/ixtlan/core/configuration_manager.rb
Instance Method Summary collapse
Instance Method Details
#cleanup ⇒ Object
69 70 71 |
# File 'lib/ixtlan/core/configuration_manager.rb', line 69 def cleanup model.clear_instance if @model end |
#configure ⇒ Object
73 74 75 76 77 78 |
# File 'lib/ixtlan/core/configuration_manager.rb', line 73 def configure registry.each do |name, callback| logger.debug{ "configure #{name}" } callback.call(model.instance) end end |
#register(name, &block) ⇒ Object
63 64 65 66 67 |
# File 'lib/ixtlan/core/configuration_manager.rb', line 63 def register(name, &block) raise "need block" unless block logger.info{"register config for: #{name}"} registry[name.to_sym] = block end |
#setup(model_name) ⇒ Object
57 58 59 60 61 |
# File 'lib/ixtlan/core/configuration_manager.rb', line 57 def setup(model_name) if model_name @model_name = model_name.to_s.classify end end |