Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Module#attr_writer

(*::interned names) -> ::Array[::Symbol]
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.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0