Class: Adhearsion::Components::ComponentManager::LazyConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/adhearsion/component_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(component_manager) ⇒ LazyConfigLoader

Returns a new instance of LazyConfigLoader.



194
195
196
# File 'lib/adhearsion/component_manager.rb', line 194

def initialize(component_manager)
  @component_manager = component_manager
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(component_name) ⇒ Object



198
199
200
201
202
# File 'lib/adhearsion/component_manager.rb', line 198

def method_missing(component_name)
  config = @component_manager.configuration_for_component_named(component_name.to_s)
  (class << self; self; end).send(:define_method, component_name) { config }
  config
end