factory-granny
Version:
Factory for building flexible JavaScript objects. Inspired by factory_girl.
19 lines (12 loc) • 331 B
JavaScript
var Registry = require('./Registry')
var box = require('./statics/box')
var Register = function () {
this.registry = new Registry
var bound = this.registry.register.bind(this.registry)
bound.box = {}
for (var fn in box) {
bound.box[fn] = box[fn].bind(this.registry)
}
return bound
}
module.exports = Register