PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Hash
U:RDoc::AnyMethod[iI" merge:ETI"Hash#merge;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"EReturns the new +Hash+ formed by merging each of +other_hashes+ ;TI"into a copy of +self+.;To:RDoc::Markup::BlankLine o; ; [I"6Each 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"EReturns 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"QReturns 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
[+]
..
[-] compare_by_identity%3f-i.ri
[edit]
[-] assoc-i.ri
[edit]
[-] merge-i.ri
[edit]
[-] has_value%3f-i.ri
[edit]
[-] include%3f-i.ri
[edit]
[-] default_proc%3d-i.ri
[edit]
[-] each_key-i.ri
[edit]
[-] size-i.ri
[edit]
[-] compare_by_identity-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[-] to_s-i.ri
[edit]
[-] delete-i.ri
[edit]
[-] %3c%3d-i.ri
[edit]
[-] key%3f-i.ri
[edit]
[-] transform_values-i.ri
[edit]
[-] value%3f-i.ri
[edit]
[-] %3c-i.ri
[edit]
[-] initialize_copy-i.ri
[edit]
[-] any%3f-i.ri
[edit]
[-] rehash-i.ri
[edit]
[-] %5b%5d%3d-i.ri
[edit]
[-] default-i.ri
[edit]
[-] to_a-i.ri
[edit]
[-] update-i.ri
[edit]
[-] flatten-i.ri
[edit]
[-] each_pair-i.ri
[edit]
[-] each_value-i.ri
[edit]
[-] filter-i.ri
[edit]
[-] new-c.ri
[edit]
[-] reject%21-i.ri
[edit]
[-] %3e-i.ri
[edit]
[-] has_key%3f-i.ri
[edit]
[-] fetch_values-i.ri
[edit]
[-] invert-i.ri
[edit]
[-] transform_keys-i.ri
[edit]
[-] fetch-i.ri
[edit]
[-] to_h-i.ri
[edit]
[-] hash-i.ri
[edit]
[-] store-i.ri
[edit]
[-] to_proc-i.ri
[edit]
[-] values_at-i.ri
[edit]
[-] each-i.ri
[edit]
[-] default_proc-i.ri
[edit]
[-] merge%21-i.ri
[edit]
[-] eql%3f-i.ri
[edit]
[-] ruby2_keywords_hash%3f-c.ri
[edit]
[-] slice-i.ri
[edit]
[-] empty%3f-i.ri
[edit]
[-] keep_if-i.ri
[edit]
[-] default%3d-i.ri
[edit]
[-] transform_values%21-i.ri
[edit]
[-] member%3f-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] cdesc-Hash.ri
[edit]
[-] keys-i.ri
[edit]
[-] reject-i.ri
[edit]
[-] shift-i.ri
[edit]
[-] filter%21-i.ri
[edit]
[-] compact-i.ri
[edit]
[-] rassoc-i.ri
[edit]
[-] %3e%3d-i.ri
[edit]
[-] dig-i.ri
[edit]
[-] transform_keys%21-i.ri
[edit]
[-] select-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] to_hash-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] except-i.ri
[edit]
[-] select%21-i.ri
[edit]
[-] replace-i.ri
[edit]
[-] %5b%5d-c.ri
[edit]
[-] clear-i.ri
[edit]
[-] ruby2_keywords_hash-c.ri
[edit]
[-] values-i.ri
[edit]
[-] length-i.ri
[edit]
[-] key-i.ri
[edit]
[-] delete_if-i.ri
[edit]
[-] compact%21-i.ri
[edit]