summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 04:45:37 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 04:45:37 +0000
commit42142d434fcbfce15e2c5b73715e4a794dba361a (patch)
treecbe27530f5e66b9504c5667250806786d7ecf4b3
parentbd0880d53217e71e44952ee3dca02ea2d178e694 (diff)
* object.c: rdoc formatting for Kernel#Array() [Backport #7931]
* array.c: Add rdoc for Array() method to Creating Arrays section git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--array.c5
-rw-r--r--object.c5
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 64bc6a190c..7b9bf3490e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 19 12:30:00 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c: rdoc formatting for Kernel#Array() [Backport #7931]
+ * array.c: Add rdoc for Array() method to Creating Arrays section
+
Sat Feb 23 16:51:00 2013 Zachary Scott <zachary@zacharyscott.net>
* thread.c: Documentation for Thread#backtrace_locations
diff --git a/array.c b/array.c
index a8b65b2c51..fb412f1c8d 100644
--- a/array.c
+++ b/array.c
@@ -5240,6 +5240,11 @@ rb_ary_drop_while(VALUE ary)
* empty_table = Array.new(3) { Array.new(3) }
* #=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
*
+ * An array can also be created by using the Array() method, provided by
+ * Kernel, which calls #to_ary or #to_a on it's argument.
+ *
+ * Array({:a => "a", :b => "b"}) #=> [[:a, "a"], [:b, "b"]]
+ *
* == Example Usage
*
* In addition to the methods it mixes in through the Enumerable module, the
diff --git a/object.c b/object.c
index b3222e56e7..1bec19297b 100644
--- a/object.c
+++ b/object.c
@@ -2747,8 +2747,9 @@ rb_Array(VALUE val)
* call-seq:
* Array(arg) -> array
*
- * Returns <i>arg</i> as an <code>Array</code>. First tries to call
- * <i>arg</i><code>.to_ary</code>, then <i>arg</i><code>.to_a</code>.
+ * Returns +arg+ as an Array.
+ *
+ * First tries to call Array#to_ary on +arg+, then Array#to_a.
*
* Array(1..5) #=> [1, 2, 3, 4, 5]
*/