Current Path : /usr/local/share/ri/1.8/system/Object/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/share/ri/1.8/system/Object/clone-i.yaml |
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Produces a shallow copy of <em>obj</em>---the instance variables of <em>obj</em> are copied, but not the objects they reference. Copies the frozen and tainted state of <em>obj</em>. See also the discussion under <tt>Object#dup</tt>. - !ruby/struct:SM::Flow::VERB body: " class Klass\n attr_accessor :str\n end\n s1 = Klass.new #=> #<Klass:0x401b3a38>\n s1.str = "Hello" #=> "Hello"\n s2 = s1.clone #=> #<Klass:0x401b3998 @str="Hello">\n s2.str[1,4] = "i" #=> "i"\n s1.inspect #=> "#<Klass:0x401b3a38 @str=\\"Hi\\">"\n s2.inspect #=> "#<Klass:0x401b3998 @str=\\"Hi\\">"\n" - !ruby/struct:SM::Flow::P body: "This method may have class-specific behavior. If so, that behavior will be documented under the #<tt>initialize_copy</tt> method of the class." full_name: Object#clone is_singleton: false name: clone params: | obj.clone -> an_object visibility: public