Docs for poems service

This commit is contained in:
Vit Brunner
2014-10-12 15:54:34 +02:00
parent f2c4cbdcba
commit 2f30d900d3
@@ -10,9 +10,17 @@ angular.module("sideBySide").service "poems", ['$q', 'fetch', ($q, fetch) ->
}]
@heading = undefined
# Get active poems
#
# @return [Array] Active poems
@getActive = () ->
(poem for poem in @all when poem.meta.Active is true)
# Activize poem based on passed rules
#
# @param poem [Object]
# @param active [Object] { meta: [ 'active', 'values' ] }
# @return poem
activize = (poem, active) ->
if !active
poem.meta.Active = true
@@ -22,6 +30,9 @@ angular.module("sideBySide").service "poems", ['$q', 'fetch', ($q, fetch) ->
poem.meta.Active = true
poem
# Load poems
#
# @param base [String]
@load = (base = '') =>
fetch(base + "/config.json").then (config) =>
$q.all(config.promises).then (results) =>