X7ROOT File Manager
Current Path:
/opt/alt/ruby18/share/ri/1.8/system/Enumerable
opt
/
alt
/
ruby18
/
share
/
ri
/
1.8
/
system
/
Enumerable
/
ðŸ“
..
ðŸ“
Enumerator
📄
all%3f-i.yaml
(856 B)
📄
any%3f-i.yaml
(877 B)
📄
cdesc-Enumerable.yaml
(2.9 KB)
📄
collect-i.yaml
(609 B)
📄
count-i.yaml
(815 B)
📄
cycle-i.yaml
(896 B)
📄
detect-i.yaml
(732 B)
📄
drop-i.yaml
(435 B)
📄
drop_while-i.yaml
(539 B)
📄
each_cons-i.yaml
(633 B)
📄
each_slice-i.yaml
(563 B)
📄
each_with_index-i.yaml
(609 B)
📄
entries-i.yaml
(546 B)
📄
enum_cons-i.yaml
(633 B)
📄
enum_slice-i.yaml
(563 B)
📄
enum_with_index-i.yaml
(609 B)
📄
find-i.yaml
(728 B)
📄
find_all-i.yaml
(541 B)
📄
find_index-i.yaml
(769 B)
📄
first-i.yaml
(455 B)
📄
grep-i.yaml
(845 B)
📄
group_by-i.yaml
(519 B)
📄
include%3f-i.yaml
(585 B)
📄
inject-i.yaml
(209 B)
📄
map-i.yaml
(601 B)
📄
max-i.yaml
(678 B)
📄
max_by-i.yaml
(466 B)
📄
member%3f-i.yaml
(583 B)
📄
min-i.yaml
(678 B)
📄
min_by-i.yaml
(460 B)
📄
minmax-i.yaml
(787 B)
📄
minmax_by-i.yaml
(567 B)
📄
none%3f-i.yaml
(895 B)
📄
one%3f-i.yaml
(893 B)
📄
partition-i.yaml
(537 B)
📄
reduce-i.yaml
(2.05 KB)
📄
reject-i.yaml
(485 B)
📄
reverse_each-i.yaml
(297 B)
📄
select-i.yaml
(537 B)
📄
sort-i.yaml
(926 B)
📄
sort_by-i.yaml
(3.16 KB)
📄
take-i.yaml
(398 B)
📄
take_while-i.yaml
(509 B)
📄
to_a-i.yaml
(540 B)
📄
to_set-i.yaml
(348 B)
📄
zip-i.yaml
(1.01 KB)
Editing: reduce-i.yaml
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::VERB body: " enum.reduce(initial, sym) => obj\n enum.reduce(sym) => obj\n enum.reduce(initial) {| memo, obj | block } => obj\n enum.reduce {| memo, obj | block } => obj\n" - !ruby/struct:SM::Flow::P body: Combines all elements of <em>enum</em> by applying a binary operation, specified by a block or a symbol that names a method or operator. - !ruby/struct:SM::Flow::P body: If you specify a block, then for each element in <em>enum<i> the block is passed an accumulator value (<i>memo</em>) and the element. If you specify a symbol instead, then each element in the collection will be passed to the named method of <em>memo</em>. In either case, the result becomes the new value for <em>memo</em>. At the end of the iteration, the final value of <em>memo</em> is the return value fo the method. - !ruby/struct:SM::Flow::P body: If you do not explicitly specify an <em>initial</em> value for <em>memo</em>, then uses the first element of collection is used as the initial value of <em>memo</em>. - !ruby/struct:SM::Flow::P body: "Examples:" - !ruby/struct:SM::Flow::VERB body: " # Sum some numbers\n (5..10).reduce(:+) #=> 45\n # Same using a block and inject\n (5..10).inject {|sum, n| sum + n } #=> 45\n # Multiply some numbers\n (5..10).reduce(1, :*) #=> 151200\n # Same using a block\n (5..10).inject(1) {|product, n| product * n } #=> 151200\n # find the longest word\n longest = %w{ cat sheep bear }.inject do |memo,word|\n memo.length > word.length ? memo : word\n end\n longest #=> "sheep"\n" full_name: Enumerable#reduce is_singleton: false name: reduce params: | enum.inject(initial, sym) => obj enum.inject(sym) => obj enum.inject(initial) {| memo, obj | block } => obj enum.inject {| memo, obj | block } => obj visibility: public
Upload File
Create Folder