Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /proc/self/root/opt/alt/ruby18/share/ri/1.8/system/Array/ |
Upload File : |
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: When invoked with a block, yield all permutations of length <em>n</em> of the elements of <em>ary</em>, then return the array itself. If <em>n</em> is not specified, yield all permutations of all elements. The implementation makes no guarantees about the order in which the permutations are yielded. - !ruby/struct:SM::Flow::P body: When invoked without a block, return an enumerator object instead. - !ruby/struct:SM::Flow::P body: "Examples:" - !ruby/struct:SM::Flow::VERB body: " a = [1, 2, 3]\n a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]\n a.permutation(1).to_a #=> [[1],[2],[3]]\n a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]\n a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]\n a.permutation(0).to_a #=> [[]] # one permutation of length 0\n a.permutation(4).to_a #=> [] # no permutations of length 4\n" full_name: Array#permutation is_singleton: false name: permutation params: | ary.permutation { |p| block } -> array ary.permutation -> enumerator ary.permutation(n) { |p| block } -> array ary.permutation(n) -> enumerator visibility: public