るりまサーチ

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

別のキーワード

  1. nomethoderror new
  2. _builtin nomethoderror
  3. nomethoderror args
  4. nomethoderror private_call?
  5. match nomethoderror

ライブラリ

検索結果

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

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

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

ハッシュが与えられたとき、それぞれのキーを生成したオブジェクトの要素にし、値をセットします。

@param hash 設定する要素とその値を指定します。
hash には Hash クラスのイン...
...たは each_pair メソッ
ドを持つオブジェクトを用いる事ができます。
@raise NoMethodError hash のキーが to_sym メソッドを持たないときに発生します。

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