summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorEspartaco Palma <esparta@gmail.com>2020-06-07 01:01:37 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-07-30 18:34:17 +0900
commitcfbae7dae052180e5dde05a27948ae8d779eccab (patch)
treeba817385d1c63e39be4bd97c064cfd5b4bb81ff1 /object.c
parent265968d675ce6f52a69e5d8ddaa82b41f89a3d2c (diff)
[skip-ci] Clarification for dup vs clone docs
Both clone & dup returns a new object when executed on the documentation looks like they are returning the same object cloned or dup'ed which is true for method as extend, but not for the above mentioned.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3192
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/object.c b/object.c
index b47635f1fd..9fb14817cd 100644
--- a/object.c
+++ b/object.c
@@ -550,11 +550,11 @@ rb_obj_clone(VALUE obj)
* s1.extend(Foo) #=> #<Klass:0x401b3a38>
* s1.foo #=> "foo"
*
- * s2 = s1.clone #=> #<Klass:0x401b3a38>
+ * s2 = s1.clone #=> #<Klass:0x401be280>
* s2.foo #=> "foo"
*
- * s3 = s1.dup #=> #<Klass:0x401b3a38>
- * s3.foo #=> NoMethodError: undefined method `foo' for #<Klass:0x401b3a38>
+ * s3 = s1.dup #=> #<Klass:0x401c1084>
+ * s3.foo #=> NoMethodError: undefined method `foo' for #<Klass:0x401c1084>
*--
* Equivalent to \c Object\#dup in Ruby
*++