るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.033秒)

別のキーワード

  1. _builtin keep_if
  2. openssl public_key
  3. _builtin each_key
  4. openssl public_key=
  5. socket pf_key

クラス

検索結果

OpenStruct#dig(key, ...) -> object | nil (346.0)

self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。

...す。途中のオブジェクトが nil であった場合は nil を返します。

@param key キーを任意個指定します。

require 'ostruct'
address = OpenStruct.new('city' => "Anytown NC", 'zip' => 12345)
person = OpenStruct.new('name' => 'John Smith', 'address' => address)
per...