Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function imagick() {
- this.composit = function(param1) { return new _composit(param1, this) }
- this.convert = function(param2) { return new _convert(param2, this) }
- }
- function _composit(param, parent) {
- // reference to parent object
- this.parentObj = parent;
- this.att = param
- console.log(this.att);
- this.test = function (obj) {
- console.log(obj);
- // return to reference from itself
- return this;
- }
- this.end = function() {
- // return to reference of parent object
- return this.parentObj;
- }
- }
- function _convert(param, parent) {
- // reference to parent object
- this.parentObj = parent;
- // saving param
- this.att = param;
- // printing att
- console.log(this.att);
- this.resize = function (obj) {
- console.log(obj);
- // return to reference from itself
- return this;
- }
- this.end = function() {
- // return to reference of parent object
- return this.parentObj;
- }
- }
- var im = new imagick();
- im.composit("test1").test("test2").end().composit("test3").test("test4");
- im.convert("blah").resize("blub").end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement