るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

Hash#to_hash -> self (18133.0)

self を返します。

...self を返します。

//emlist[例][ruby]{
hash
= {}
p
hash.to_hash # => {}
p
hash.to_hash == hash # => true
//}

@see Object#to_hash, Hash#to_h...

Hash#replace(other) -> self (6150.0)

ハッシュの内容を other の内容で置き換えます。

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

self = other.to_hash.dup と同じです。

@param other ハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return sel...
...{2 => 'B', 3 => 'C'}

foo.replace(bar)
p
foo #=> {2=>"B", 3=>"C"}

zoo = {}
zoo = bar.dup
p
zoo #=> {2=>"B", 3=>"C"}

class Foo
def to_hash
{:japan => 'kyoto'}
end
end

h = Hash.new
h.replace(Foo.new) #暗黙の変換
p
h #=> {:japan=>"kyoto"}
//}

@see Hash#dup,Hash#merge,Object#to_hash...

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

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のself...
..., 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#replace...

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

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のself...
..., 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#replace...

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

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のsel...
...'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 (3138.0)

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のsel...
...'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) -> Hash (50.0)

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...=> '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...
..._hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end

h = {:Germany => 'Berlin',
:Australia => 'Canberra',
:France => 'Paris'
}

# 暗黙の変換
p
h.merge(Foo.new) # => {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
//}

@see Hash#update,Hash#rep...

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

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...=> '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...
..._hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end

h = {:Germany => 'Berlin',
:Australia => 'Canberra',
:France => 'Paris'
}

# 暗黙の変換
p
h.merge(Foo.new) # => {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
//}

@see Hash#update,Hash#rep...

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

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...=> '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...
..._hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end

h = {:Germany => 'Berlin',
:Australia => 'Canberra',
:France => 'Paris'
}

# 暗黙の変換
p
h.merge(Foo.new) # => {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
//}

@see Hash#update,Hash#rep...

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

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージした結...
...=> '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...
..._hash
{:Australia => 'Sydney',
:France => 'Paris'
}
end
end

h = {:Germany => 'Berlin',
:Australia => 'Canberra',
:France => 'Paris'
}

# 暗黙の変換
p
h.merge(Foo.new) # => {:Germany=>"Berlin", :Australia=>"Sydney", :France=>"Paris"}
//}

@see Hash#update,Hash#rep...

絞り込み条件を変える

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

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のself...
..., 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#replace...

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

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

...値を使います。

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

@param others マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のself...
..., 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#replace...

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

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のsel...
...'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 (38.0)

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

...r の値を使います。

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

@param other マージ用のハッシュまたはメソッド to_hash でハッシュに変換できるオブジェクトです。
@return マージ後のsel...
...'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!...