attr_reader(...)
public
Creates instance variables and corresponding methods that return the value
of each instance variable. Equivalent to calling ``attr:name'' on
each name in turn.
Show source
/*
* call-seq:
* attr_reader(symbol, ...) => nil
*
* Creates instance variables and corresponding methods that return the
* value of each instance variable. Equivalent to calling
* ``<code>attr</code><i>:name</i>'' on each name in turn.
*/
static VALUE
rb_mod_attr_reader(argc, argv, klass)
int argc;
VALUE *argv;
VALUE klass;
{
int i;
for (i=0; i<argc; i++) {
rb_attr(klass, rb_to_id(argv[i]), 1, 0, Qtrue);
}
return Qnil;
}