[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.
This commit is contained in:
Espartaco Palma 2020-06-07 01:01:37 -07:00 коммит произвёл Hiroshi SHIBATA
Родитель 265968d675
Коммит cfbae7dae0
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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
*++