るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

検索結果

Hash#clear -> self (117349.0)

ハッシュの中身を空にします。

...ハッシュの中身を空にします。

空にした後のselfを返します。
デフォルト値の設定はクリアされません。

//emlist[例][ruby]{
h = Hash.new("default value")
h[:some] = "some"
p h #=> {:some=>"some"}

h.clear

p h #=> {}
p h.default #=> "default value"
//}...