A Registry Class for Mootools
Nathan White has posted over on his blog a nice bit of work. He’s released a registry class for MooTools that lets you do stuff like this:
var reg = new Registry();
reg.set('/Options/Default',{'name' : 'test', 'version' : 1});
reg.set('/Options/Default/name', 'changed');
reg.set('/dynamically/creates/nested/objects', true);
reg.get('/Options/Default');
/* returns { name : 'changed', version : 1 } */
reg.get('/Options/Default/version'); // returns 1
I have an extension to Hash in my libraries that lets you get a value from a path but it isn’t bi-directional – you can’t push data in using a path. Nice work Nathan!
No TweetBacks yet. (Be the first to Tweet this post)
Follow @clientcide on twitter to get notified of new posts.
To follow me personally on twitter, follow @anutron.