⚝
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
/
Hash
/
View File Name :
merge%21-i.ri
U:RDoc::AnyMethod[iI"merge!:ETI"Hash#merge!;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Merges each of +other_hashes+ into +self+; returns +self+.;To:RDoc::Markup::BlankLine o; ; [I"5Each argument in +other_hashes+ must be a \Hash.;T@o; ; [I".\Method #update is an alias for \#merge!.;T@o; ; [I"!With arguments and no block:;To:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"?Returns +self+, after the given hashes are merged into it.;To;;0; [o; ; [I"/The given hashes are merged left to right.;To;;0; [o; ; [I"(Each new entry is added at the end.;To;;0; [o; ; [I"DEach duplicate-key entry's value overwrites the previous value.;T@o; ; [I" Example:;To:RDoc::Markup::Verbatim; [ I""h = {foo: 0, bar: 1, baz: 2} ;TI"h1 = {bat: 3, bar: 4} ;TI"h2 = {bam: 5, bat:6} ;TI"Ih.merge!(h1, h2) # => {:foo=>0, :bar=>4, :baz=>2, :bat=>6, :bam=>5} ;T:@format0o; ; [I" With arguments and a block:;To;; ;;[ o;;0; [o; ; [I"7Returns +self+, after the given hashes are merged.;To;;0; [o; ; [I"/The given hashes are merged left to right.;To;;0; [o; ; [I",Each new-key entry is added at the end.;To;;0; [o; ; [I"For each duplicate key:;To;; ;;[o;;0; [o; ; [I"=Calls the block with the key and the old and new values.;To;;0; [o; ; [I"BThe block's return value becomes the new value for the entry.;T@o; ; [I" Example:;To;; [ I""h = {foo: 0, bar: 1, baz: 2} ;TI"h1 = {bat: 3, bar: 4} ;TI"h2 = {bam: 5, bat:6} ;TI"Qh3 = h.merge!(h1, h2) { |key, old_value, new_value| old_value + new_value } ;TI";h3 # => {:foo=>0, :bar=>5, :baz=>2, :bat=>9, :bam=>5} ;T;0o; ; [I"With no arguments:;To;; ;;[o;;0; [o; ; [I" Returns +self+, unmodified.;To;;0; [o; ; [I"%The block, if given, is ignored.;T@o; ; [I" Example:;To;; [ I""h = {foo: 0, bar: 1, baz: 2} ;TI".h.merge # => {:foo=>0, :bar=>1, :baz=>2} ;TI"Ih1 = h.merge! { |key, old_value, new_value| raise 'Cannot happen' } ;TI"(h1 # => {:foo=>0, :bar=>1, :baz=>2};T;0: @fileI"hash.c;T:0@omit_headings_from_table_of_contents_below000[ I"(*args);T@~FI" Hash;TcRDoc::NormalClass0[@|FI"update;T