るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.067秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:at[x] > クエリ:open[x] > バージョン:2.7.0[x] > ライブラリ:ostruct[x]

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. env to_h
  4. struct to_h
  5. array to_h

クラス

検索結果

OpenStruct#each_pair -> Enumerator (45907.0)

self の各要素の名前と要素を引数としてブロックを評価します。

...ックを評価します。

ブロックを指定した場合は self を返します。そうでない場合は
Enumerator を返します。

例:

require 'ostruct'
data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
data.each_pair.to_a # => population, 20000000...