るりまサーチ

最速Rubyリファレンスマニュアル検索!
300件ヒット [1-100件を表示] (0.043秒)
トップページ > クエリ:@[x] > クエリ:merge[x]

別のキーワード

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

ライブラリ

クラス

モジュール

オブジェクト

検索結果

<< 1 2 3 > >>

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

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

...場合、othersのメソッドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "...
...#=> {"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, newval| newv...
.../emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4 => 'D'}

p foo.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"...

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

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

...場合、othersのメソッドto_hashを使って暗黙の変換を試みます。

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

//emlist[][ruby]{
h1 = { "a" => 100, "...
...#=> {"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, newval| newv...
.../emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4 => 'D'}

p foo.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"...

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

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

...試みます。

@
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 # => {"a"=>100, "b"=>200}
//}

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4...
...=> 'D'}

p foo.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...

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

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

...試みます。

@
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 # => {"a"=>100, "b"=>200}
//}

//emlist[][ruby]{
foo = {1 => 'a', 2 => 'b', 3 => 'c'}
bar = {2 => 'B', 3 => 'C', 4...
...=> 'D'}

p foo.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...

Set#merge(enum) -> self (18119.0)

元の集合に enum で与えられた要素を追加します。

...あります。

@
param enum 追加対象の要素を格納したオブジェクトを指定します。
@
raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
require 'set'
set = Set[10, 20]
set.merge([10, 30])
p set #...
...必要があります。

@
param enum 追加対象の要素を格納したオブジェクトを指定します。
@
raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
set = Set[10, 20]
set.merge([10, 30])
p set # => #...

絞り込み条件を変える

URI::Generic#merge(rel) -> URI::Generic (15137.0)

自身と与えられたパス rel を連結した新しい URI オブジェクトを生成して返します。

...結します。


@
param rel 連結したいパスを文字列か URI オブジェクトで与えます。

例:
require 'uri'
p URI.parse('http://example.com/') + '/foo/bar.html'
#=> #<URI::HTTP:0x201001c0 URL:http://example.com/foo/bar.html>
URI('http://a/b/c/d;p?q').merge('?y')...
...;p?q').merge('/./g') #=> #<URI::HTTP:0xb7ca2738 URL:http://a/g>
URI('http://a/b/c/d;p?q').merge('/../g') #=> #<URI::HTTP:0xb7ca2008 URL:http://a/g>
URI('http://a/b/c/d;p?q').merge('../../../g') #=> #<URI::HTTP:0xb7ca1888 URL:http://a/g>
URI('http://a/b/c/d;p?q').merge('../....

JSON::State#merge(options = {}) -> self (15113.0)

与えられたハッシュで自身を設定します。

...ュで自身を設定します。

オプションで使用するハッシュのキーについては JSON::State.new を参照してください。

@
param options このオブジェクトの設定をするためのハッシュを指定します。

//emlist[例][ruby]{
require "json"

json_state =...
...y1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"

json_state.configure(indent: " ")
json_state.indent # => " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}

@
see JSON::State.new...

Hash#merge!(*others) -> self (6150.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 (6150.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 (6132.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 (6132.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!...

Kernel#merge_libs(*libs) -> [String] (6123.0)

@todo 使われてない

...@todo 使われてない

@
param libs ???...

URI::Generic#merge!(rel) -> self (6113.0)

与えられたパス rel を自身へ連結します。

....parse(rel) によって、URI に変換してから連結します。

@
param rel 連結したいパスを文字列か URI オブジェクトで与えます。

例:
require 'uri'
u = URI.parse('http://example.com/')
u.merge!('/foo/bar.html')
p u.to_s #=> h...
<< 1 2 3 > >>