<commit_before>'use strict';

var Component = require('./component');
var bind = require('./module/bind');

var defaults = {
    //disabled: false
    error: false,
    bind: {
        'element.click': 'emit.click',
        'element.mouseup': 'emit.mouseup'
    }
};

/**
 * control class
 *
 * @class
 */
class Control extends Component {

    /**
     * [init description]
     * @return {void} [description]
     */
    init(options) {
        super.init(options);

        var opts = this.options;

        this.value = opts.value;
        this.readonly = opts.read;

        this.disabled = this.options.disabled;
    }

    /**
     * [isEnable description]
     * @return {boolean}
     */
    isEnable() {
        if (this.state === 'disabled') {
            return false;
        } else {
            return true;
        }
    }
}

module.exports = Control;<commit_msg>add proper setter and getter<commit_after>'use strict';

var Component = require('./component');
var bind = require('./module/bind');

var defaults = {
    //disabled: false
    error: false,
    bind: {
        'element.click': 'emit.click',
        'element.mouseup': 'emit.mouseup'
    }
};

/**
 * control class
 *
 * @class
 */
class Control extends Component {

    /**
     * [init description]
     * @return {void} [description]
     */
    init(options) {
        super.init(options);

        var opts = this.options;

        this.value = opts.value;
        this.readonly = opts.read;

        this.disabled = this.options.disabled;
    }



    /**
     * Setter
     * @param {string} prop
     * @param {string} value
     */
    set(prop, value) {

        switch(prop) {
            case 'value':
                this.setValue(value);
                break;
            default:
                this.setValue(value);

        }

        return this;
    }

    /**
     * Getter
     * @param {string} prop
     * @param {string} value
     */
    get(prop) {
        var value;

        switch(prop) {
            case 'value':
                value = this.getValue(prop);
                break;
            default: 
                return this.getValue(prop);
        }

        return value;
    }

    /**
     * [getValue description]
     * @return {instance} The class instance
     */
    getValue(){
        return this.input.get('value');
    }

    /**
     * [setValue description]
     * @param {string} value [description]
     */
    setValue(value){
        this.input.attribute('value', value);
        this.emit('change', value);
    }

    /**
     * [isEnable description]
     * @return {boolean}
     */
    isEnable() {
        if (this.state === 'disabled') {
            return false;
        } else {
            return true;
        }
    }
}

module.exports = Control;
{'fraction_non_alphanumeric': 0.14137437365783823, 'fraction_numerical': 0.0, 'mean_word_length': 1.5903614457831325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3165222', 'n_tokens_mistral': 833, 'n_tokens_neox': 803, 'n_words': 177}