関連するキーワード
検索結果
先頭5件
-
Hash
# update(other) -> self (18115) -
selfとotherのハッシュの内容をマージ(統合)します。Hash#merge!と同じです。
...合)します。Hash#merge!と同じです。
デフォルト値はselfの設定のままです。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param other マージ用のハッシュまたはメソッド to_hash でハッシュ......> '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 (18115) -
selfとotherのハッシュの内容をマージ(統合)します。Hash#merge!と同じです。
...合)します。Hash#merge!と同じです。
デフォルト値はselfの設定のままです。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param other マージ用のハッシュまたはメソッド to_hash でハッシュ......> '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) -> self (13) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...でない
場合は常に other の値を使います。
Hash#merge! は、マージの結果でselfを変更する破壊的メソッドで、Hash#update の別名です。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param oth......_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"}
class Foo
def to_hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end
h = {:Germany => 'Berlin',
:Australia => 'Canberra',......:France => 'Paris'
}
h.merge!(Foo.new) #暗黙の変換
p h #=> {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
@see Hash#update,Hash#replace... -
Hash
# merge!(other) {|key , self _ val , other _ val| . . . } -> self (13) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...でない
場合は常に other の値を使います。
Hash#merge! は、マージの結果でselfを変更する破壊的メソッドで、Hash#update の別名です。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param oth......_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"}
class Foo
def to_hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end
h = {:Germany => 'Berlin',
:Australia => 'Canberra',......:France => 'Paris'
}
h.merge!(Foo.new) #暗黙の変換
p h #=> {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
@see Hash#update,Hash#replace... -
Hash
# merge(other) -> Hash (13) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...でない
場合は常に other の値を使います。
Hash#merge! は、マージの結果でselfを変更する破壊的メソッドで、Hash#update の別名です。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param oth......_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"}
class Foo
def to_hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end
h = {:Germany => 'Berlin',
:Australia => 'Canberra',......:France => 'Paris'
}
h.merge!(Foo.new) #暗黙の変換
p h #=> {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
@see Hash#update,Hash#replace... -
Hash
# merge(other) {|key , self _ val , other _ val| . . . } -> Hash (13) -
selfとotherのハッシュの内容をマージ(統合)した結果を返します。デフォルト値はselfの設定のままです。
...でない
場合は常に other の値を使います。
Hash#merge! は、マージの結果でselfを変更する破壊的メソッドで、Hash#update の別名です。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。
@param oth......_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"}
class Foo
def to_hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end
h = {:Germany => 'Berlin',
:Australia => 'Canberra',......:France => 'Paris'
}
h.merge!(Foo.new) #暗黙の変換
p h #=> {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
@see Hash#update,Hash#replace...
