Skip to content

Commit

Permalink
Use methods instead of '_' assignment for configure
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoguchi committed Apr 22, 2012
1 parent d9cb787 commit e5a8876
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/modules/everymodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ var everyModule = module.exports = {
return this;
}

, configure: function (properties) {
for (var property in properties) {
var k = '_' + property;
this[k] = properties[property];
// Convenience method for all you coffee-script lovers, e.g.,
//
// everyauth.dropbox.configure
// consumerKey: conf.dropbox.consumerKey
// consumerSecret: conf.dropbox.consumerSecret
// findOrCreateUser: (sess, accessToken, accessSecret, dbMeta) -> users[dbMeta.uid] or= addUser('dropbox', dbMeta)
// redirectPath: '/'
, configure: function (conf) {
for (var k in conf) {
this[k](conf[k]);
}
return this;
}
Expand Down

0 comments on commit e5a8876

Please sign in to comment.