summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorRadosław Bułat <radek.bulat@gmail.com>2020-12-18 17:40:31 +0100
committerYusuke Endoh <mame@ruby-lang.org>2020-12-19 09:22:26 +0900
commitd40d95296d0947edf513ad5bc7d4bf338b2e3877 (patch)
treea6973cc038f7575147474a04ebf6158ec889ecd1 /object.c
parent76e88480371469400346fca609efe67096813915 (diff)
Feature 17314: update docs and NEWS about attr* methods returning array of symbols
Diffstat (limited to 'object.c')
-rw-r--r--object.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/object.c b/object.c
index b50a3b949b..b532dd3a84 100644
--- a/object.c
+++ b/object.c
@@ -2255,10 +2255,10 @@ id_for_attr(VALUE obj, VALUE name)
/*
* call-seq:
- * attr_reader(symbol, ...) -> nil
- * attr(symbol, ...) -> nil
- * attr_reader(string, ...) -> nil
- * attr(string, ...) -> nil
+ * attr_reader(symbol, ...) -> array
+ * attr(symbol, ...) -> array
+ * attr_reader(string, ...) -> array
+ * attr(string, ...) -> array
*
* Creates instance variables and corresponding methods that return the
* value of each instance variable. Equivalent to calling
@@ -2283,9 +2283,9 @@ rb_mod_attr_reader(int argc, VALUE *argv, VALUE klass)
/**
* call-seq:
- * attr(name, ...) -> nil
- * attr(name, true) -> nil
- * attr(name, false) -> nil
+ * attr(name, ...) -> array
+ * attr(name, true) -> array
+ * attr(name, false) -> array
*
* The first form is equivalent to #attr_reader.
* The second form is equivalent to <code>attr_accessor(name)</code> but deprecated.
@@ -2314,8 +2314,8 @@ rb_mod_attr(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * attr_writer(symbol, ...) -> nil
- * attr_writer(string, ...) -> nil
+ * attr_writer(symbol, ...) -> array
+ * attr_writer(string, ...) -> array
*
* Creates an accessor method to allow assignment to the attribute
* <i>symbol</i><code>.id2name</code>.
@@ -2339,8 +2339,8 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
- * attr_accessor(symbol, ...) -> nil
- * attr_accessor(string, ...) -> nil
+ * attr_accessor(symbol, ...) -> array
+ * attr_accessor(string, ...) -> array
*
* Defines a named attribute for this module, where the name is
* <i>symbol.</i><code>id2name</code>, creating an instance variable
@@ -2350,7 +2350,7 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
* Returns an array of defined methods names as symbols.
*
* module Mod
- * attr_accessor(:one, :two)
+ * attr_accessor(:one, :two) #=> [:one, :one=, :two, :two=]
* end
* Mod.instance_methods.sort #=> [:one, :one=, :two, :two=]
*/