るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

キーワード

検索結果

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...