U:RDoc::AnyMethod[iI"permutation:ETI"Array#permutation;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"LWhen invoked with a block, yield all permutations of length +n+ of the ;TI"9elements of the array, then return the array itself.;To:RDoc::Markup::BlankLineo; ; [I"EIf +n+ is not specified, yield all permutations of all elements.;T@o; ; [I"IThe implementation makes no guarantees about the order in which the ;TI"permutations are yielded.;T@o; ; [I"=If no block is given, an Enumerator is returned instead.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [ I"a = [1, 2, 3] ;TI"Qa.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] ;TI"-a.permutation(1).to_a #=> [[1],[2],[3]] ;TI"Ea.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]] ;TI"Qa.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] ;TI"Ba.permutation(0).to_a #=> [[]] # one permutation of length 0 ;TI"Aa.permutation(4).to_a #=> [] # no permutations of length 4;T: @format0: @fileI" array.c;T:0@omit_headings_from_table_of_contents_below0I"Æary.permutation { |p| block } -> ary ary.permutation -> Enumerator ary.permutation(n) { |p| block } -> ary ary.permutation(n) -> Enumerator ;T0[I"(p1 = v1);T@&FI" Array;TcRDoc::NormalClass00