module Configurability::DeferredConfig
Mixin that can be applied to classes to cause them to configure themselves as soon as they are able to.
Public Class Methods
extended( mod )
click to toggle source
Extension hook: log when the mixin is used.
Calls superclass method
# 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
singleton_method_added( sym )
click to toggle source
Singleton method definition hook: configure the instance as soon as it overrides the configure method supplied by the Configurability
mixin itself.
Calls superclass method
# 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