PATH:
opt
/
alt
/
ruby18
/
share
/
ri
/
1.8
/
system
/
Array
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: When invoked with a block, yields all combinations of length <em>n</em> of elements from <em>ary</em> and then returns <em>ary</em> itself. The implementation makes no guarantees about the order in which the combinations are yielded. - !ruby/struct:SM::Flow::P body: When invoked without a block, returns an enumerator object instead. - !ruby/struct:SM::Flow::P body: "Examples:" - !ruby/struct:SM::Flow::VERB body: " a = [1, 2, 3, 4]\n a.combination(1).to_a #=> [[1],[2],[3],[4]]\n a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]\n a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]\n a.combination(4).to_a #=> [[1,2,3,4]]\n a.combination(0).to_a #=> [[]] # one combination of length 0\n a.combination(5).to_a #=> [] # no combinations of length 5\n" full_name: Array#combination is_singleton: false name: combination params: | ary.combination(n) { |c| block } -> ary ary.combination(n) -> enumerator visibility: public
[-] pack-i.yaml
[edit]
[-] frozen%3f-i.yaml
[edit]
[-] reject-i.yaml
[edit]
[-] drop-i.yaml
[edit]
[-] %3c%3d%3e-i.yaml
[edit]
[-] size-i.yaml
[edit]
[-] compact%21-i.yaml
[edit]
[-] drop_while-i.yaml
[edit]
[-] product-i.yaml
[edit]
[-] concat-i.yaml
[edit]
[-] collect%21-i.yaml
[edit]
[-] pretty_print_cycle-i.yaml
[edit]
[-] flatten%21-i.yaml
[edit]
[-] fetch-i.yaml
[edit]
[-] reverse%21-i.yaml
[edit]
[-] %2a-i.yaml
[edit]
[-] to_ary-i.yaml
[edit]
[-] indices-i.yaml
[edit]
[-] empty%3f-i.yaml
[edit]
[-] to_yaml-i.yaml
[edit]
[-] values_at-i.yaml
[edit]
[-] last-i.yaml
[edit]
[-] hash-i.yaml
[edit]
[-] join-i.yaml
[edit]
[-] pretty_print-i.yaml
[edit]
[-] yaml_initialize-i.yaml
[edit]
[-] %5b%5d%3d-i.yaml
[edit]
[-] assoc-i.yaml
[edit]
[-] find_index-i.yaml
[edit]
[-] shelljoin-i.yaml
[edit]
[-] %2d-i.yaml
[edit]
[-] flatten-i.yaml
[edit]
[-] %3c%3c-i.yaml
[edit]
[-] cdesc-Array.yaml
[edit]
[-] pop-i.yaml
[edit]
[-] transpose-i.yaml
[edit]
[-] take-i.yaml
[edit]
[-] index-i.yaml
[edit]
[-] insert-i.yaml
[edit]
[-] include%3f-i.yaml
[edit]
[-] cycle-i.yaml
[edit]
[-] uniq-i.yaml
[edit]
[-] reverse_each-i.yaml
[edit]
[-] at-i.yaml
[edit]
[-] abbrev-i.yaml
[edit]
[-] initialize_copy-i.yaml
[edit]
[-] compact-i.yaml
[edit]
[-] map-i.yaml
[edit]
[-] %2b-i.yaml
[edit]
[-] inspect-i.yaml
[edit]
[-] choice-i.yaml
[edit]
[-] delete-i.yaml
[edit]
[-] unshift-i.yaml
[edit]
[-] nitems-i.yaml
[edit]
[-] uniq%21-i.yaml
[edit]
[-] combination-i.yaml
[edit]
[-] dclone-i.yaml
[edit]
[-] clear-i.yaml
[edit]
[-] each_index-i.yaml
[edit]
[-] rassoc-i.yaml
[edit]
[-] reject%21-i.yaml
[edit]
[-] push-i.yaml
[edit]
[-] %3d%3d-i.yaml
[edit]
[-] rindex-i.yaml
[edit]
[-] sort%21-i.yaml
[edit]
[-] permutation-i.yaml
[edit]
[-] %5b%5d-c.yaml
[edit]
[-] %5b%5d-i.yaml
[edit]
[-] to_a-i.yaml
[edit]
[-] take_while-i.yaml
[edit]
[-] map%21-i.yaml
[edit]
[-] collect-i.yaml
[edit]
[-] fill-i.yaml
[edit]
[-] eql%3f-i.yaml
[edit]
[-] delete_at-i.yaml
[edit]
[-] length-i.yaml
[edit]
[+]
..
[-] slice-i.yaml
[edit]
[-] delete_if-i.yaml
[edit]
[-] select-i.yaml
[edit]
[-] each-i.yaml
[edit]
[-] indexes-i.yaml
[edit]
[-] sort-i.yaml
[edit]
[-] new-c.yaml
[edit]
[-] shift-i.yaml
[edit]
[-] count-i.yaml
[edit]
[-] %26-i.yaml
[edit]
[-] %7c-i.yaml
[edit]
[-] to_s-i.yaml
[edit]
[-] replace-i.yaml
[edit]
[-] shuffle-i.yaml
[edit]
[-] slice%21-i.yaml
[edit]
[-] first-i.yaml
[edit]
[-] zip-i.yaml
[edit]
[-] shuffle%21-i.yaml
[edit]
[-] reverse-i.yaml
[edit]