Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Module#attr_writer

attr_writer(symbol, ...) → array
attr_writer(string, ...) → array

Creates an accessor method to allow assignment to the attribute symbol.id2name. String arguments are converted to symbols. Returns an array of defined method names as symbols.

Ruby version changes

  1. 3.0
See also #attr_reader #autoload #attr_accessor #autoload? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0