Add method setSummary to book

This commit is contained in:
Samy Pessé
2016-04-28 11:17:33 +02:00
parent 4763f1342c
commit e62bc31e63
2 changed files with 13 additions and 4 deletions
+12
View File
@@ -191,6 +191,18 @@ Book.prototype.addLanguageBook = function(language, book) {
return this.set('books', books);
};
/**
Set the summary for this book
@param {Summary}
@return {Book}
*/
Book.prototype.setSummary = function(summary) {
return this.set('summary', summary);
};
/**
Change log level
+1 -4
View File
@@ -30,8 +30,6 @@ function parseSummary(book) {
var summary = Summary.createFromParts(file, result.parts);
// Insert readme as first entry
var firstArticle = summary.getFirstArticle();
if (!firstArticle || firstArticle.getRef() !== readmeFile.getPath()) {
@@ -41,9 +39,8 @@ function parseSummary(book) {
});
}
// Set new summary
return book.set('summary', summary);
return book.setSummary(summary);
});
}