mmai/glicko2js — pull request #5 by KenanY (2014-08-01 18:25:44+00:00)
Title: Allow for setting individual options

Currently, the `Glicko2` class expects a complete `settings` _Object_. Thus, if one wanted to only change, say, the default rating, they **cannot** simply do this:

``` js
var glicko = new glicko2.Glicko2({
rating: 1600
});
```

Instead, one must pass the entire `settings` _Object_, even if they want to change just one value:

``` js
var glicko = new glicko2.Glicko2({
tau: 0.5,
rating: 1600, // but I only wanted to worry about this :(
rd: 350,
vol: 0.06,
volatility_algorithm: 'newprocedure'
});
```

This patch fixes this issue by checking for each individual setting in the `settings` _Object_ instead of just checking for the entire _Object_ itself. This way, one does not have to pass a complete `settings` _Object_ if they only want to change a few values.

An alternative way to do this would be to _extend_ the `default_settings` _Object_ (which this patch removes) with whatever is passed as `settings`. npm modules like [xtend](https://github.com/Raynos/xtend) and [lodash.assign](https://www.npmjs.org/package/lodash.assign) provide this functionality, but in order to maintain Bower support (which doesn't support `require()` calls), I would have had to setup a whole build system that would inline one of these modules before publish. Way too much work, especially for a tool I do not use.