GeoKnow/Jassa-Core

View on GitHub
lib/util/Slot.js

Summary

Maintainability
A
35 mins
Test Coverage
var Class = require('../ext/Class');

var Slot = Class.create({
    initialize : function(obj, attr, meta) {
        this.obj = obj;
        this.attr = attr;

        this.meta = meta;
    },

    setValue : function(value) {
        this.obj[this.attr] = value;
    },

    getValue : function() {
        return this.obj[this.attr];
    },

    getMeta : function() {
        return this.meta;
    },

    toString : function() {
        return JSON.stringify(this);
    }
});

module.exports = Slot;