Skip to content

Instantly share code, notes, and snippets.

@heymichaelp
Created July 10, 2014 17:00
Show Gist options
  • Save heymichaelp/32adcd599a30b5128801 to your computer and use it in GitHub Desktop.
Save heymichaelp/32adcd599a30b5128801 to your computer and use it in GitHub Desktop.
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