UNPKG

lettuce

Version:

Lettuce JS, Mini Mobile Framework for Romantic with DSL.

39 lines (26 loc) 742 B
var Parser = new Lettuce.prototype.Class(function () { }); Parser.prototype.init = function () { }; var DSLRunner = { run: function(methods) { this.methods = methods; this.execute('first'); for (var key in this.methods) { if (key !== 'last' && key.match(/.*Page/)) { this.execute(key); } } this.execute('last'); }, execute: function(methodName) { var output = this.methods[methodName](); delete(this.methods[methodName]); return output; } }; Parser.prototype = Lettuce.extend(Parser.prototype, DSLRunner); var parser = { Parser: Parser }; Lettuce.prototype = Lettuce.extend(Lettuce.prototype, parser);