77件ヒット
[1-77件を表示]
(0.027秒)
種類
- インスタンスメソッド (44)
- モジュール関数 (22)
- 特異メソッド (11)
ライブラリ
- json (77)
クラス
-
JSON
:: State (55)
モジュール
- JSON (22)
キーワード
- generate (11)
-
object
_ nl= (11) -
to
_ h (11) -
to
_ hash (11) - unparse (11)
検索結果
先頭5件
-
JSON
:: State # object _ nl -> String (18137.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。
..."json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(object_nl: "\n")
json_state.object_nl # => "\n"
puts JSON.... -
JSON
:: State . new(options = {}) -> JSON :: State (18125.0) -
自身を初期化します。
...ブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。デフォルトは空文字列です。
: :object_nl
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
デフォルト......ire "json"
json_state = JSON::State.new(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}
//emlist[例 JSON::State を指定][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
copy = JSON::State.new(json_state)
copy.class # => JSON::E... -
JSON
:: State # object _ nl=(string) (6131.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。
...{
require "json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state.object_nl = "\n"
json_state.object_nl # => "\n"
puts JSON.generate(... -
JSON
. # generate(object , state = nil) -> String (12.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :......][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}
@see JSON::State, JSO... -
JSON
. # unparse(object , state = nil) -> String (12.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :......][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")
JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => "[1,2,{\"name\": \"tanaka\",\"age\": 19}]"
//}
@see JSON::State, JSO... -
JSON
:: State # to _ h -> Hash (12.0) -
自身をハッシュに変換します。
...に変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>10... -
JSON
:: State # to _ hash -> Hash (12.0) -
自身をハッシュに変換します。
...に変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>10...