るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

検索結果

Enumerable#to_h(*args) -> Hash (18120.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...y]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}

ブロックを指定すると各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>9, 4=>16,...

Enumerable#to_h(*args) { ... } -> Hash (18120.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...y]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}

ブロックを指定すると各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>9, 4=>16,...