るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.071秒)

別のキーワード

  1. _builtin merge!
  2. hash merge!
  3. set merge
  4. hash merge
  5. _builtin merge

クラス

検索結果

Hash#merge!(*others) -> self (18127.0)

selfとothersのハッシュの内容を順番にマージ(統合)します。

...黙の変換を試みます。

@
param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge! #=> {"a"=>100, "b"=>...
...2 = { "b" => 246, "c" => 300 }
h1.merge!(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1 #=> {"a"=>100, "b"=>246, "c"=>300}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) #=> {"a"=>100, "b"=>357...
...357, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) {|key, v1, v2| v1 }
#=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200, "c"=>300,...

Hash#merge!(*others) {|key, self_val, other_val| ... } -> self (18127.0)

selfとothersのハッシュの内容を順番にマージ(統合)します。

...黙の変換を試みます。

@
param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge! #=> {"a"=>100, "b"=>...
...2 = { "b" => 246, "c" => 300 }
h1.merge!(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1 #=> {"a"=>100, "b"=>246, "c"=>300}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) #=> {"a"=>100, "b"=>357...
...357, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) {|key, v1, v2| v1 }
#=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200, "c"=>300,...

Hash#merge!(other) -> self (18121.0)

selfとotherのハッシュの内容をマージ(統合)します。

...試みます。

@
param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge!(h2) # => {"...
...'B', 3 => 'C', 4 => 'D'}

p foo.update(bar) #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}

p foo.update(bar) {|key, foo_val, bar_val| foo_val + bar_val } # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
p foo # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
//}

@
see Hash#merge!...

Hash#merge!(other) {|key, self_val, other_val| ... } -> self (18121.0)

selfとotherのハッシュの内容をマージ(統合)します。

...試みます。

@
param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge!(h2) # => {"...
...'B', 3 => 'C', 4 => 'D'}

p foo.update(bar) #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}

p foo.update(bar) {|key, foo_val, bar_val| foo_val + bar_val } # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
p foo # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
//}

@
see Hash#merge!...

Hash#update(*others) -> self (3027.0)

selfとothersのハッシュの内容を順番にマージ(統合)します。

...黙の変換を試みます。

@
param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge! #=> {"a"=>100, "b"=>...
...2 = { "b" => 246, "c" => 300 }
h1.merge!(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1 #=> {"a"=>100, "b"=>246, "c"=>300}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) #=> {"a"=>100, "b"=>357...
...357, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) {|key, v1, v2| v1 }
#=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200, "c"=>300,...

絞り込み条件を変える

Hash#update(*others) {|key, self_val, other_val| ... } -> self (3027.0)

selfとothersのハッシュの内容を順番にマージ(統合)します。

...黙の変換を試みます。

@
param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge! #=> {"a"=>100, "b"=>...
...2 = { "b" => 246, "c" => 300 }
h1.merge!(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1 #=> {"a"=>100, "b"=>246, "c"=>300}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) #=> {"a"=>100, "b"=>357...
...357, "c"=>300, "d"=>400}
//}

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 246, "c" => 300 }
h3 = { "b" => 357, "d" => 400 }
h1.merge!(h2, h3) {|key, v1, v2| v1 }
#=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
h1 #=> {"a"=>100, "b"=>200, "c"=>300,...

Hash#update(other) -> self (3021.0)

selfとotherのハッシュの内容をマージ(統合)します。

...試みます。

@
param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge!(h2) # => {"...
...'B', 3 => 'C', 4 => 'D'}

p foo.update(bar) #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}

p foo.update(bar) {|key, foo_val, bar_val| foo_val + bar_val } # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
p foo # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
//}

@
see Hash#merge!...

Hash#update(other) {|key, self_val, other_val| ... } -> self (3021.0)

selfとotherのハッシュの内容をマージ(統合)します。

...試みます。

@
param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@
return マージ後のselfを返します。

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge!(h2) # => {"...
...'B', 3 => 'C', 4 => 'D'}

p foo.update(bar) #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo #=> {1=>"a", 2=>"B", 3=>"C", 4=>"D"}

p foo.update(bar) {|key, foo_val, bar_val| foo_val + bar_val } # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
p foo # => {1=>"a", 2=>"BB", 3=>"CC", 4=>"DD"}
//}

@
see Hash#merge!...