HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/ri/3.0.0/system/Array/combination-i.ri
U:RDoc::AnyMethod[iI"combination:ETI"Array#combination;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"ICalls the block, if given, with combinations of elements of +self+; ;TI"@returns +self+. The order of combinations is indeterminate.;To:RDoc::Markup::BlankLineo;
;	[I"_When a block and an in-range positive \Integer argument +n+ (<tt>0 < n <= self.size</tt>) ;TI"Jare given, calls the block with all +n+-tuple combinations of +self+.;T@o;
;	[I"
Example:;To:RDoc::Markup::Verbatim;	[I"a = [0, 1, 2]
;TI"5a.combination(2) {|combination| p combination }
;T:@format0o;
;	[I"Output:;To;;	[I"[0, 1]
;TI"[0, 2]
;TI"[1, 2]
;T;
0o;
;	[I"Another example:;To;;	[I"a = [0, 1, 2]
;TI"5a.combination(3) {|combination| p combination }
;T;
0o;
;	[I"Output:;To;;	[I"[0, 1, 2]
;T;
0o;
;	[I"DWhen +n+ is zero, calls the block once with a new empty \Array:;To;;	[I"a = [0, 1, 2]
;TI":a1 = a.combination(0) {|combination| p combination }
;T;
0o;
;	[I"Output:;To;;	[I"[]
;T;
0o;
;	[I"LWhen +n+ is out of range (negative or larger than <tt>self.size</tt>), ;TI"does not call the block:;To;;	[I"a = [0, 1, 2]
;TI"=a.combination(-1) {|combination| fail 'Cannot happen' }
;TI"<a.combination(4) {|combination| fail 'Cannot happen' }
;T;
0o;
;	[I"1Returns a new \Enumerator if no block given:;To;;	[I"a = [0, 1, 2]
;TI"Ba.combination(2) # => #<Enumerator: [0, 1, 2]:combination(2)>;T;
0:
@fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Zarray.combination(n) {|element| ... } -> self
array.combination(n) -> new_enumerator
;T0[I"	(p1);T@MFI"
Array;TcRDoc::NormalClass00