Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created August 24, 2010 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsbradleyjr/547167 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/547167 to your computer and use it in GitHub Desktop.
Joose.Class('Class1', {
use : [ 'Class2' ],
has : {
myAttr : {
is : 'rw',
lazy : function () { return new Class2({ passed : this.getPassThis() }) }
},
passThis : {
is : 'rw',
init : null
}
},
methods : {
initialize : function () {
this.getMyAttr()
}
}
})
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