Module: SafeExec

Defined in:
scripts/00003 SafeExec.rb

Overview

Module responsive of savely execute piece of code at the end of the whole script loading

Constant Summary collapse

SAFE_CONSTANTS =

Safe constants to evaluate when everything is loaded

{}
SAFE_CODE =

List of safe piece of code to execute

{}

Class Method Summary collapse

Class Method Details

.load

Load the safe constants/codes and clear the hash



9
10
11
12
13
14
15
16
17
18
# File 'scripts/00003 SafeExec.rb', line 9

def load
  SAFE_CONSTANTS.each_value do |consts|
    consts.each_value(&:call)
  end
  SAFE_CONSTANTS.clear
  SAFE_CODE.each_value do |codes|
    codes.each_value(&:call)
  end
  SAFE_CODE.clear
end