$99 GRAYBYTE WORDPRESS FILE MANAGER $43

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby18/share/ri/1.8/system/Enumerable/

HOME
Current File : /opt/alt/ruby18/share/ri/1.8/system/Enumerable//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&lt;i&gt; the block is passed an accumulator value (&lt;i&gt;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(:+)                            #=&gt; 45\n   # Same using a block and inject\n   (5..10).inject {|sum, n| sum + n }            #=&gt; 45\n   # Multiply some numbers\n   (5..10).reduce(1, :*)                         #=&gt; 151200\n   # Same using a block\n   (5..10).inject(1) {|product, n| product * n } #=&gt; 151200\n   # find the longest word\n   longest = %w{ cat sheep bear }.inject do |memo,word|\n      memo.length &gt; word.length ? memo : word\n   end\n   longest                                       #=&gt; &quot;sheep&quot;\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


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.50 PM
root / linksafe
0755
Enumerator
--
3 Mar 2024 10.50 PM
root / linksafe
0755
all%3f-i.yaml
0.836 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
any%3f-i.yaml
0.856 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
cdesc-Enumerable.yaml
2.902 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
collect-i.yaml
0.595 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
count-i.yaml
0.796 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
cycle-i.yaml
0.875 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
detect-i.yaml
0.715 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
drop-i.yaml
0.425 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
drop_while-i.yaml
0.526 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
each_cons-i.yaml
0.618 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
each_slice-i.yaml
0.55 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
each_with_index-i.yaml
0.595 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
entries-i.yaml
0.533 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
enum_cons-i.yaml
0.618 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
enum_slice-i.yaml
0.55 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
enum_with_index-i.yaml
0.595 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
find-i.yaml
0.711 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
find_all-i.yaml
0.528 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
find_index-i.yaml
0.751 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
first-i.yaml
0.444 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
grep-i.yaml
0.825 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
group_by-i.yaml
0.507 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
include%3f-i.yaml
0.571 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
inject-i.yaml
0.204 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
map-i.yaml
0.587 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
max-i.yaml
0.662 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
max_by-i.yaml
0.455 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
member%3f-i.yaml
0.569 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
min-i.yaml
0.662 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
min_by-i.yaml
0.449 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
minmax-i.yaml
0.769 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
minmax_by-i.yaml
0.554 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
none%3f-i.yaml
0.874 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
one%3f-i.yaml
0.872 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
partition-i.yaml
0.524 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
reduce-i.yaml
2.052 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
reject-i.yaml
0.474 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
reverse_each-i.yaml
0.29 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
select-i.yaml
0.524 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
sort-i.yaml
0.904 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
sort_by-i.yaml
3.164 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
take-i.yaml
0.389 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
take_while-i.yaml
0.497 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
to_a-i.yaml
0.527 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
to_set-i.yaml
0.34 KB
26 Jul 2023 1.47 PM
root / linksafe
0644
zip-i.yaml
1.009 KB
26 Jul 2023 1.47 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF