Skip to content

Instantly share code, notes, and snippets.

@ericf
Created May 9, 2012 18:29
Show Gist options
  • Select an option

  • Save ericf/2647723 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/2647723 to your computer and use it in GitHub Desktop.
Y.SquareList = Y.Base.create('squareList', Y.ModelList, [], { /* ... */ });
Y.Game = Y.Base.create('game', Y.Model, [], {
initializer: function () {
this._squareList = new Y.SquareList();
},
_getSquareList: function () {
return this._squareList;
},
_setSquareList: function (squares) {
return this._squareList.reset(squares);
}
}, {
ATTRS: {
squareList: {
getter : '_getSquareList',
setter : '_setSquareList',
validator: Y.Lang.isArray,
value : []
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment