-
Notifications
You must be signed in to change notification settings - Fork 1
/
Project.gs
31 lines (28 loc) · 861 Bytes
/
Project.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function Project(rowRange) {
Row.call(this, rowRange)
this.markAsComplete = function() {
this.status = CONSTS.STATUS.COMPLETED
this.commitToRow()
this._moveToSheet(CONSTS.SHEETS.COMPLETED_PROJECTS)
}
this.moveToProjects = function() {
this._moveToSheet(CONSTS.SHEETS.PROJECTS)
}
}
Project.prototype = Object.create(Row.prototype)
Project.prototype.constructor = Project
Project.prototype.hydrate = function() {
var row = this.rowRange.getValues()
this.title = row[0][0]
this.description = row[0][1]
this.type = row[0][2]
this.status = row[0][3]
}
Project.prototype.commitToRow = function() {
var values = this.rowRange.getValues()
values[0][0] = this.title
values[0][1] = this.description
values[0][2] = this.type
values[0][3] = this.status
this.rowRange.setValues(values)
}