ライブラリ
- ビルトイン (30)
-
json
/ add / ostruct (24) - ostruct (209)
- rake (36)
クラス
- Array (10)
- Hash (10)
- OpenStruct (221)
-
Rake
:: Application (12) - Struct (10)
モジュール
- Rake (24)
キーワード
- == (12)
- InspectKey (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (5) - [] (12)
- []= (12)
- application (12)
- application= (12)
-
delete
_ field (12) - dig (40)
-
each
_ pair (24) - eql? (12)
- hash (12)
- inspect (12)
-
json
/ add / ostruct (12) -
json
_ create (12) - modifiable (12)
- new (12)
-
new
_ ostruct _ member (12) -
to
_ h (19) -
to
_ json (12) -
to
_ s (12)
検索結果
先頭5件
-
OpenStruct
# to _ json(*args) -> String (21000.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
# to _ s -> String (21000.0) -
オブジェクトを人間が読める形式に変換した文字列を返します。
オブジェクトを人間が読める形式に変換した文字列を返します。
@see Object#inspect -
OpenStruct
:: InspectKey -> : _ _ inspect _ key _ _ (21000.0) -
内部的に使用する定数です。
内部的に使用する定数です。 -
Rake
:: Application # options -> OpenStruct (107.0) -
コマンドラインで与えられたアプリケーションのオプションを返します。
...//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
Rake.application.options # => #<OpenStruct always_multitask=false, backtrace=false, build_all=false, dryrun=false, ignore_deprecate=false, ignore_system=false, job_stats=false, load_system... -
NEWS for Ruby 2
. 0 . 0 (54.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ly GCM mode is supported.
* ostruct
* 追加: OpenStruct#[] , OpenStruct#[]=
* 追加: OpenStruct#each_pair
* 追加: OpenStruct#eql?
* 追加: OpenStruct#hash
* 追加: OpenStruct#to_h
* 拡張: OpenStruct.new OpenStruct/Struct のインスタンスを受け付けるよ......推奨: Zlib::GzipReader#lines, Zlib::GzipReader#bytes
=== 標準添付ライブラリの互換性 (機能追加とバグ修正を除く)
* OpenStruct の新しいメソッドはカスタム属性の名前を衝突するかもしれません。
"each_pair", "eql?", "hash" or "to_h".
* Dir... -
json
/ add / ostruct (16.0) -
OpenStruct に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。
...OpenStruct に JSON 形式の文字列に変換するメソッドや JSON 形式の文字列から Ruby のオブジェクトに変換するメソッドを定義します。... -
NEWS for Ruby 2
. 6 . 0 (12.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...なく
Enumerator::ArithmeticSequence クラスのインスタンスを返すようになりました。
* OpenStruct
* 変更されたメソッド
* OpenStruct#to_h はブロックを受け取りキーと値のペアを新しいキーと値に変換できるようになりま... -
NEWS for Ruby 3
. 0 . 0 (12.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ult.
* OpenStruct
* Initialization is no longer lazy. 12136
* Builtin methods can now be overridden safely. 15409
* Implementation uses only methods ending with `!`.
* Ractor compatible.
* Improved support for YAML. 8382
* Use officially discouraged. Read OpenStruct@Caveats... -
Array
# dig(idx , . . . ) -> object | nil (6.0) -
self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。
...ます。
//emlist[例][ruby]{
a = [[1, [2, 3]]]
a.dig(0, 1, 1) # => 3
a.dig(1, 2, 3) # => nil
a.dig(0, 0, 0) # => TypeError: Fixnum does not have #dig method
[42, {foo: :bar}].dig(1, :foo) # => :bar
//}
@see Hash#dig, Struct#dig, OpenStruct#dig......ます。
//emlist[例][ruby]{
a = [[1, [2, 3]]]
a.dig(0, 1, 1) # => 3
a.dig(1, 2, 3) # => nil
a.dig(0, 0, 0) # => TypeError: Integer does not have #dig method
[42, {foo: :bar}].dig(1, :foo) # => :bar
//}
@see Hash#dig, Struct#dig, OpenStruct#dig... -
Hash
# dig(key , . . . ) -> object | nil (6.0) -
self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。
...します。
@param key キーを任意個指定します。
//emlist[例][ruby]{
h = { foo: {bar: {baz: 1}}}
h.dig(:foo, :bar, :baz) # => 1
h.dig(:foo, :zot, :xyz) # => nil
g = { foo: [10, 11, 12] }
g.dig(:foo, 1) # => 11
//}
@see Array#dig, Struct#dig, OpenStruct#dig...