Created
July 10, 2014 17:00
-
-
Save heymichaelp/32adcd599a30b5128801 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 _ = require('underscore'); | |
var Q = require('q'); | |
var EligibleForSportsEnrollmentPolicy = function( student ) { | |
this.student = student; | |
}; | |
EligibleForSportsEnrollmentPolicy.prototype = _.extend( EligibleForSportsEnrollmentPolicy.prototype, { | |
run: function() { | |
return this.isNotExpelled() && this.isNotSuspended() && this.isPassing(); | |
}, | |
isNotExpelled: function() { | |
return this.student.isExpelled !== true; | |
}, | |
isNotSuspended: function() { | |
return this.student.isSuspended !== true; | |
}, | |
isPassing: function() { | |
return new PassingStudentPolicy( this.student ).run(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment