2件ヒット
[1-2件を表示]
(0.116秒)
別のキーワード
検索結果
-
OpenStruct
# dig(key , . . . ) -> object | nil (91.0) -
self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。
...合は nil を返します。
@param key キーを任意個指定します。
require 'ostruct'
address = OpenStruct.new('city' => "Anytown NC", 'zip' => 12345)
person = OpenStruct.new('name' => 'John Smith', 'address' => address)
person.dig(:address, 'zip') # => 12345
person.di... -
OpenStruct
# eql?(other) -> bool (91.0) -
self と other が等しい場合に true を返します。そうでない場合は false を 返します。
...self と other が等しい場合に true を返します。そうでない場合は false を
返します。
具体的には other が OpenStruct オブジェクトかそのサブクラスでかつ、
self の各要素を保持した内部の Hash が eql? で比較して等しい場合に
true...