Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created August 24, 2010 08:12
Show Gist options
  • Save canonic-epicure/547172 to your computer and use it in GitHub Desktop.
Save canonic-epicure/547172 to your computer and use it in GitHub Desktop.
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