Blame view

lib/arcus-mutation.js 593 Bytes
40206905   David Thor   Added project files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
        }
    }
};