File: //usr/share/ri/3.0.0/system/Hash/update-i.ri
U:RDoc::AnyMethod[iI"update:ETI"Hash#update;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_below0I"~hash.merge! -> self
hash.merge!(*other_hashes) -> self
hash.merge!(*other_hashes) { |key, old_value, new_value| ... } -> self
;T0[[I"merge!;T@ I"(*args);T@~FI" Hash;TcRDoc::NormalClass00