Last active
August 29, 2015 14:06
-
-
Save Aupajo/0a0f427dae54a7ad34ff to your computer and use it in GitHub Desktop.
Woto application
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
var Candidacy = function(applicant) { | |
this.applicant = applicant; | |
}; | |
Candidacy.SCORE_DIMENSIONS = [ | |
'creativity', | |
'socialMediaEngagement', | |
'freshGraduate', | |
'passionate', | |
'workEthic' | |
]; | |
Candidacy.prototype.score = function() { | |
Candidacy.SCORE_DIMENSIONS.reduce(function(total, dimension) { | |
return total += applicant[dimension]; | |
}, 0); | |
throw new ArbitraryError("Really? Social media engagement?"); | |
}; | |
Candidacy.prototype.submitApplication = function() { | |
EmailService.deliver({ | |
subject: "Applicant", | |
to: "apply@woto.com", | |
from: this.applicant.email, | |
body: this.applicant.introduction, | |
attachment: this.applicant.cvURL | |
}); | |
}; | |
// Reviewer's comments: Why are we bothering with this? |
Also, most "dimensions" are nouns, but "passionate" is an adjective. Suggest changing to "passion", with 0 as a possible value.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Warning: "applicant[dimension]" may be undefined, meaning total may end up NaN. The constructor should set default values for supported attributes.