Created
August 24, 2010 08:12
-
-
Save canonic-epicure/547172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('Task/Joose/NodeJS') | |
var puts = require('sys').puts | |
Joose.Class('Class1', { | |
//use : [ 'Class2' ], | |
has : { | |
myAttr : { | |
is : 'rw', | |
lazy : function () { | |
puts( 'Inside lazy = ' + this.getPassThis() ) | |
return new Class2({ passed : this.getPassThis() }) | |
} | |
}, | |
passThis : { | |
is : 'rw', | |
init : null | |
} | |
}, | |
methods : { | |
initialize : function () { | |
puts('Inside initialize = ' + this.getMyAttr().passed) | |
} | |
} | |
}) | |
Joose.Class('Class2', { | |
has : { | |
passed : { | |
is : 'rw', | |
init : null | |
} | |
} | |
}) | |
var myInstance = new Class1({ passThis : 'someValue' }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment