るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.015秒)
トップページ > バージョン:2.3.0[x] > クエリ:Hash[x] > ライブラリ:ostruct[x] > 種類:特異メソッド[x]

別のキーワード

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

クラス

検索結果

OpenStruct.new(hash = nil) -> OpenStruct (385.0)

OpenStruct オブジェクトを生成します。

...たは each_pair メソッ
ドを持つオブジェクトを用いる事ができます。
@raise NoMethodError hash のキーが to_sym メソッドを持たないときに発生します。

require 'ostruct'
some1 = OpenStruct.new({:a =>"a",:b =>"b"}) # => #<OpenStruct b="b", a="a">...