⚝
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-i.ri
U:RDoc::AnyMethod[iI" merge:ETI"Hash#merge;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"DReturns the new \Hash formed by merging each of +other_hashes+ ;TI"into a copy of +self+.;To:RDoc::Markup::BlankLine o; ; [I"5Each argument in +other_hashes+ must be a \Hash.;T@S:RDoc::Markup::Rule:weighti@o; ; [I"!With arguments and no block:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"DReturns the new \Hash object formed by merging each successive ;TI")\Hash in +other_hashes+ into +self+.;To;;0; [o; ; [I",Each new-key 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"Hh.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"PReturns a new \Hash object that is the merge of +self+ and each given hash.;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"Ph3 = 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 a copy of +self+.;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"Hh1 = 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_below0I"‹hash.merge -> copy_of_self hash.merge(*other_hashes) -> new_hash hash.merge(*other_hashes) { |key, old_value, new_value| ... } -> new_hash ;T0[ I"(*args);T@yFI" Hash;TcRDoc::NormalClass00