21 lines
303 B
Text
21 lines
303 B
Text
var Config = {
|
|
new: func(cfg)
|
|
{
|
|
var m = {
|
|
parents: [Config],
|
|
_cfg: cfg
|
|
};
|
|
if( typeof(m._cfg) != "hash" )
|
|
m._cfg = {};
|
|
|
|
return m;
|
|
},
|
|
get: func(key, default = nil)
|
|
{
|
|
var val = me._cfg[key];
|
|
if( val != nil )
|
|
return val;
|
|
|
|
return default;
|
|
}
|
|
};
|