Created
June 7, 2012 15:47
-
-
Save howarddierking/2889580 to your computer and use it in GitHub Desktop.
RestBugs Bug JavaScript Object
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
function Bug(title, description) { | |
var self = this; | |
this.title = title; | |
this.description = description; | |
this.assignedTo = ''; | |
this.status = ''; | |
this.history = []; | |
function addToHistory(comments, stateChanges){ | |
self.history.push({ | |
addedOn: new Date(), | |
comments: comments, | |
changes: stateChanges | |
}); | |
}; | |
function updateStatus(status, comments){ | |
self.status = status; | |
addToHistory(comments, {status : self.status}); | |
}; | |
this.activate = function(comments){ | |
updateStatus('Working', comments); | |
}; | |
this.resolve = function(comments){ | |
updateStatus('QA', comments); | |
}; | |
this.close = function(comments){ | |
updateStatus('Done', comments); | |
}; | |
this.toBacklog = function(comments){ | |
updateStatus('Backlog', comments); | |
}; | |
this.toBacklog("created"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment