るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.021秒)
トップページ > ライブラリ:ビルトイン[x] > バージョン:2.5.0[x] > クエリ:hash[x] > クエリ:key[x] > 種類:モジュール関数[x]

別のキーワード

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

モジュール

検索結果

Kernel.#Hash(arg) -> Hash (18868.0)

引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で Hash オブジェクトに変換します。nil か [] を指定した場合は空の Hash オブジェクトを返します。

引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で
Hash オブジェクトに変換します。nil か [] を指定した場合は空の
Hash オブジェクトを返します。

@param arg 変換対象のオブジェクトを指定します。

//emlist[例][ruby]{
Hash([]) # => {}
Hash(nil) # => {}
Hash(key: :value) # => {:key => :value}
Hash([1, 2, 3]) # => TypeError
//}

@raise TypeError 変換できな...