Module: ConfigLoader::Delegator

Defined in:
lib/config_loader/delegator.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



7
8
9
10
# File 'lib/config_loader/delegator.rb', line 7

def method_missing(m, *args, &block)
	raise "A #config method must be defined in the container for ConfigLoader::Delegator, for it to delegate to #config: delegation attempted with #{m}" unless self.respond_to?(:config)
  config.send(m)
end

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/config_loader/delegator.rb', line 3

def self.included(base)
	base.send :include, ConfigLoader
end