Configurability::

DeferredConfig

module

Mixin that can be applied to classes to cause them to configure themselves as soon as they are able to.

Public Class Methods

anchor
extended( mod )

Extension hook: log when the mixin is used.

# File lib/configurability/deferred_config.rb, line 11
def self::extended( mod )
        Configurability.log.debug "Adding deferred configuration hook to %p" % [ mod ]
        super
end

Public Instance Methods

anchor
singleton_method_added( sym )

Singleton method definition hook: configure the instance as soon as it overrides the configure method supplied by the Configurability mixin itself.

# File lib/configurability/deferred_config.rb, line 19
def singleton_method_added( sym )
        super

        if sym == :configure
                Configurability.log.debug "Re-configuring %p via deferred config hook." % [ self ]
                config = Configurability.loaded_config
                Configurability.log.debug "Propagating config to %p" % [ self ]
                Configurability.install_config( config, self )
        end
end