Module: Invar::TestExtension::LoadHook

Included in:
Invar
Defined in:
lib/invar/test.rb

Overview

Adds methods to the main Invar module itself for a global-access hook to be used in application init phase.

Instance Method Summary collapse

Instance Method Details

#after_load {|the| ... } ⇒ void

This method returns an undefined value.

Block that will be run after loading from config files.

It is intended to allow test suites to tweak configurations without having to duplicate the entire config file.

Yield Parameters:

  • the

    configs from the Invar



40
41
42
# File 'lib/invar/test.rb', line 40

def after_load(&block)
   RealityMethods.__after_load_hooks__.push(block)
end

#clear_hooksObject



30
31
32
# File 'lib/invar/test.rb', line 30

def clear_hooks
   RealityMethods.__after_load_hooks__.clear
end