Skip to content

Commit

Permalink
fixing style issues and errant comment
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsender committed Nov 20, 2011
1 parent e6847c1 commit 47ea8a4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/abacus.entity.js
@@ -1,9 +1,10 @@
(function( window, Abacus ) {
// Express the Player function which is used by addPlayer
// to add a player to Abacus
// Express the Entity function
function Entity() {}
// Setup the Entity prototype with methods for opperating
// on entity instances
Entity.prototype = {
addAchievement : function( options ) {
addAchievement: function( options ) {
options = options || {};

// Create a new achievement
Expand All @@ -20,25 +21,25 @@
return this;
},
// Serialize the entity
toJSON : function() {
toJSON: function() {
return JSON.stringify( this.attributes );
},
// Get the value of an entity's property.
get : function( prop ) {
get: function( prop ) {
return this.attributes[prop];
},
// Returns `true` if the property contains a value that is not null
// or undefined.
has : function( prop ) {
has: function( prop ) {
return this.attributes[prop] != null;
},
// Set a property on an entity's attributes
set : function( prop, value ) {
set: function( prop, value ) {
this.attributes[ prop ] = value;
return this;
},
// Remove a property from the entity
unset : function( prop ) {
unset: function( prop ) {
delete this.attributes[prop];
return this;
}
Expand Down

0 comments on commit 47ea8a4

Please sign in to comment.