Skip to content

Commit

Permalink
add two new methods: getWritable(); getEnumerable()
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelzhang committed Oct 23, 2013
1 parent 6d3ebb4 commit 2b818f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions index.js
Expand Up @@ -249,6 +249,25 @@ mix(Profile.prototype, {
return this.profile.enumerable();
},

getWritable: function () {
return this._getFromList(this.writable());
},

getEnumerable: function () {
return this._getFromList(this.enumerable());
},

_getFromList: function (list) {
var data = {};
var profile = this.profile;

list.forEach(function (key) {
data[key] = profile.option(key);
});

return data;
},

// prepare environment
_prepare: function() {
// the attributes for multi-profile itself
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "multi-profile",
"version": "2.0.1",
"version": "2.1.1",
"description": "Multi-profile is a module to manage global configurations for multiple profiles.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 2b818f8

Please sign in to comment.