hubot-bingo
Version:
A hubot script that plays Buzzword bingo
13 lines (8 loc) • 311 B
text/coffeescript
_ = require('lodash')
class Scores
constructor: (@wins, @scores) ->
totalScores: ->
_.map(@scores, _.property 'currentMatches').reduce(_.add, @wins)
currentMatches: ->
_.map(@scores, (value, buzzword) -> "#{buzzword}: #{value.currentMatches}/#{value.requiredMatches}")
module.exports = Scores