るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. httpstatus rc_see_other
  2. webrick/httpstatus rc_see_other
  3. rc_see_other webrick/httpstatus
  4. rc_see_other webrick::httpstatus

ライブラリ

キーワード

検索結果

OpenStruct#dig(key, ...) -> object | nil (61.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#to_json(*args) -> String (61.0)

自身を JSON 形式の文字列に変換して返します。

自身を JSON 形式の文字列に変換して返します。

内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

@see JSON::Generator::GeneratorMethods::Hash#to_json

OpenStruct#inspect -> String (43.0)

オブジェクトを人間が読める形式に変換した文字列を返します。

オブジェクトを人間が読める形式に変換した文字列を返します。

@see Object#inspect

OpenStruct#to_s -> String (43.0)

オブジェクトを人間が読める形式に変換した文字列を返します。

オブジェクトを人間が読める形式に変換した文字列を返します。

@see Object#inspect