Description

Defines the properties that can be only read

Usage

Parameters

  • Properties {Array}

    names in an array

Returns

Object

Example

Class.create("Foo", {

    mymethod: function() {
        console.log(this.bar.get());
    }

}).attr_reader(["bar"]);

Discussion