るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.040秒)
トップページ > クラス:Hash[x] > クエリ:key[x] > クエリ:merge[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. openssl public_key
  2. _builtin each_key
  3. openssl public_key=
  4. dbm key
  5. socket pf_key

キーワード

検索結果

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

selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。 デフォルト値はselfの設定のままです。

...値を使います。

othersがハッシュではない場合、othersのメソッドto_hashを使って暗黙の変換を試みます。

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...00 }
h1.merge #=> {"a"=>100, "b"=>200}
h1.merge(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1.merge(h2, h3) #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
h1.merge(h2) {|key, oldval, newval| newval - oldval}
#=> {"a"=>100, "b"=>46, "c"=>300}
h1.merge(h2, h3) {|key, oldval...
...o.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo # => {1=>"a", 2=>"b", 3=>"c"}

p foo.merge!(bar) {|key, foo_val, bar_val| foo_val + bar_val }
# => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
p foo # => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
//}

//emlist[][ruby]{
class Foo
def to_hash...

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

selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge() # => {"a"=>100, "b"=>200}
h1.merge(h2) # => {"a"=>100, "b"=>254, "c"=>300}
h1.merge(h2){|key, oldval, newval| newval - oldval}
# => {"a"=>100, "b"=>54, "c"=>300}
h1...
...o.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo # => {1=>"a", 2=>"b", 3=>"c"}

p foo.merge!(bar) {|key, foo_val, bar_val| foo_val + bar_val }
# => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
p foo # => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
//}

//emlist[][ruby]{
class Foo
def to_hash...

Hash#merge(*others) -> Hash (18172.0)

selfとothersのハッシュの内容を順番にマージ(統合)した結果を返します。 デフォルト値はselfの設定のままです。

...値を使います。

othersがハッシュではない場合、othersのメソッドto_hashを使って暗黙の変換を試みます。

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...00 }
h1.merge #=> {"a"=>100, "b"=>200}
h1.merge(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
h1.merge(h2, h3) #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
h1.merge(h2) {|key, oldval, newval| newval - oldval}
#=> {"a"=>100, "b"=>46, "c"=>300}
h1.merge(h2, h3) {|key, oldval...
...o.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo # => {1=>"a", 2=>"b", 3=>"c"}

p foo.merge!(bar) {|key, foo_val, bar_val| foo_val + bar_val }
# => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
p foo # => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
//}

//emlist[][ruby]{
class Foo
def to_hash...

Hash#merge(other) -> Hash (18154.0)

selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge() # => {"a"=>100, "b"=>200}
h1.merge(h2) # => {"a"=>100, "b"=>254, "c"=>300}
h1.merge(h2){|key, oldval, newval| newval - oldval}
# => {"a"=>100, "b"=>54, "c"=>300}
h1...
...o.merge(bar)
# => {1=>"a", 2=>"B", 3=>"C", 4=>"D"}
p foo # => {1=>"a", 2=>"b", 3=>"c"}

p foo.merge!(bar) {|key, foo_val, bar_val| foo_val + bar_val }
# => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
p foo # => {1=>"a", 2=>"bB", 3=>"cC", 4=>"D"}
//}

//emlist[][ruby]{
class Foo
def to_hash...

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

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

...ドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge!...
...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...
..."=>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, "d"=>40...

絞り込み条件を変える

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

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

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

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

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => '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!(*others) -> self (6149.0)

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

...ドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge!...
...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...
..."=>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, "d"=>40...

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

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

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

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

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => '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) {|key, self_val, other_val| ... } -> self (3149.0)

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

...ドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge!...
...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...
..."=>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, "d"=>40...

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

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

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

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

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => '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 (3049.0)

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

...ドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "b" => 200 }
h1.merge!...
...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...
..."=>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, "d"=>40...

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

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

...の値を使います。

otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

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

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

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => '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!...