관리-도구
편집 파일: %5b%5d%3d-i.yaml
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Element Assignment---Sets the element at <em>index</em>, or replaces a subarray starting at <em>start</em> and continuing for <em>length</em> elements, or replaces a subarray specified by <em>range</em>. If indices are greater than the current capacity of the array, the array grows automatically. A negative indices will count backward from the end of the array. Inserts elements if <em>length</em> is zero. If <tt>nil</tt> is used in the second and third form, deletes elements from <em>self</em>. An <tt>IndexError</tt> is raised if a negative index points past the beginning of the array. See also <tt>Array#push</tt>, and <tt>Array#unshift</tt>. - !ruby/struct:SM::Flow::VERB body: " a = Array.new\n a[4] = "4"; #=> [nil, nil, nil, nil, "4"]\n a[0, 3] = [ 'a', 'b', 'c' ] #=> ["a", "b", "c", nil, "4"]\n a[1..2] = [ 1, 2 ] #=> ["a", 1, 2, nil, "4"]\n a[0, 2] = "?" #=> ["?", 2, nil, "4"]\n a[0..2] = "A" #=> ["A", "4"]\n a[-1] = "Z" #=> ["A", "Z"]\n a[1..-1] = nil #=> ["A"]\n" full_name: Array#[]= is_singleton: false name: "[]=" params: | array[index] = obj -> obj array[start, length] = obj or an_array or nil -> obj or an_array or nil array[range] = obj or an_array or nil -> obj or an_array or nil visibility: public