From 4020690576aa690c14295869a4cb2c266a44811c Mon Sep 17 00:00:00 2001 From: David Thor Date: Sun, 21 Dec 2014 13:54:57 -0500 Subject: [PATCH] Added project files --- LICENSE | 19 +++++++++++++++++++ lib/arcus-mutation.js | 19 +++++++++++++++++++ package.json | 26 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 LICENSE create mode 100644 lib/arcus-mutation.js create mode 100644 package.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f88fc48 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2014 Arcus Solutions + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/lib/arcus-mutation.js b/lib/arcus-mutation.js new file mode 100644 index 0000000..d7fa4f6 --- /dev/null +++ b/lib/arcus-mutation.js @@ -0,0 +1,19 @@ +/** + * Created by Michael Muesch on 8/24/2014. + */ + +exports.generateMethods = function(object){ + for(var key in object){ + if(typeof object[key] != "function"){ + (function(key){ + var uppercaseKey = key.charAt(0).toUpperCase() + key.slice(1); + object.constructor.prototype["get"+uppercaseKey] = function(){ + return this[key]; + }; + object.constructor.prototype["set"+uppercaseKey] = function(value){ + this[key] = value; + }; + })(key) + } + } +}; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..db53220 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "arcus-mutation", + "description": "Automatically generate default accessors and mutators for a class.", + "main": "./lib/arcus-mutation", + "author": { + "name": "Michael Muesch" + }, + "version": "0.1.0", + "repository": { + "type": "git", + "url": "https://github.com/ArcusSolutions/arcus-mutation.git" + }, + "bugs": { + "url": "https://github.com/ArcusSolutions/arcus-mutation/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/caolan/async/raw/master/LICENSE" + } + ], + "readmeFilename": "README.md", + "homepage": "https://github.com/ArcusSolutions/arcus-mutation", + "_id": "arcus-mutation@0.1.0", + "_from": "arcus-mutation@*" +} -- libgit2 0.21.2