121件ヒット
[1-100件を表示]
(0.093秒)
種類
- インスタンスメソッド (66)
- モジュール関数 (22)
- 特異メソッド (22)
- 文書 (11)
ライブラリ
- json (88)
- prettyprint (11)
-
rexml
/ document (11)
クラス
-
JSON
:: State (66) - PrettyPrint (11)
-
REXML
:: Attribute (11)
モジュール
- JSON (22)
検索結果
先頭5件
-
JSON
:: State # indent -> String (27313.0) -
インデントに使用する文字列を返します。
...インデントに使用する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}... -
JSON
:: State # indent=(string) (15319.0) -
インデントに使用する文字列をセットします。
...ring インデントに使用する文字列を指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.i......ndent = " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}... -
JSON
:: State # configure(options = {}) -> self (9124.0) -
与えられたハッシュで自身を設定します。
...キーについては JSON::State.new を参照してください。
@param options このオブジェクトの設定をするためのハッシュを指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1:......"value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.configure(indent: " ")
json_state.indent # => " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}
@see JSON::State.new... -
REXML
:: Attribute # write(output , indent = -1) -> object (6307.0) -
output に self の情報を name='value' という形式で書き込みます。
...output に self の情報を name='value' という形式で書き込みます。
output が返ります。
@param output 書き込み先の IO オブジェクト
@param indent インデントレベル、ここでは無視される... -
JSON
:: State # merge(options = {}) -> self (6124.0) -
与えられたハッシュで自身を設定します。
...キーについては JSON::State.new を参照してください。
@param options このオブジェクトの設定をするためのハッシュを指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1:......"value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.configure(indent: " ")
json_state.indent # => " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{ \"key1\":\"value1\", \"key2\":\"value2\"}"
//}
@see JSON::State.new... -
PrettyPrint
# group(indent = 0 , open _ obj = & # 39;& # 39; , close _ obj = & # 39;& # 39; , open _ width = open _ obj . length , close _ width = close _ obj . length) { . . . } -> () (3407.0) -
与えられたブロックを実行します。 ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても よい同じグループに属すると仮定されます。
...、1行にまとめて表示しても
よい同じグループに属すると仮定されます。
もう少し詳しく説明します。pretty printing アルゴリズムはインデントと改行を、
ツリー構造を作ることによって決定します。そして、group メソッドは......ram indent グループのインデントの深さを指定します。
@param open_obj 指定された場合、self.text(open_obj, open_width) がブロックが
実行される前に呼ばれます。開き括弧などを出力するのに使用されます。
@param close_obj......場合、self.text(close_obj, close_width) がブロックが
実行された後に呼ばれます。閉じ括弧などを出力するのに使用されます。
@param open_width open_obj のカラムを指定します。
@param close_width close_obj のカラムを指定しま... -
JSON
:: State . new(options = {}) -> JSON :: State (3230.0) -
自身を初期化します。
...を初期化します。
@param options ハッシュを指定します。
指定可能なオプションは以下の通りです。
: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
JSON 形式の文字列のトーク......す。
: :space_before
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。デフォルトは空文字列です。
: :object_nl
JSON 形式の文字列中に現れる JavaScript のオブジェクト......ます。
デフォルトは空文字列です。
: :array_nl
JSON 形式の文字列中に現れる JavaScript の配列の行末に挿入する文字列を指定します。
デフォルトは空文字列です。
: :check_circular
真を指定した場合、生成するオブジェクト... -
JSON
:: State . from _ state(options) -> JSON :: State (3224.0) -
与えられた options によって生成した JSON::State のインスタンスを返します。
...与えられた options によって生成した JSON::State のインスタンスを返します。
@param options JSON::State のインスタンスか、ハッシュを指定します。
@return options がハッシュである場合は、それによって初期化した JSON::State を......options が JSON::State のインスタンスである場合は単に
options を返します。いずれでも無い場合は、何も設定されていない JSON::State の
インスタンスを返します。
//emlist[例 Hash を指定][ruby]{
require "json"
json_state = JSON:......te(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}
//emlist[例 JSON::State を指定][ruby]{
require "json"
json_state = JSON::State.from_state(indent: "\t")
# JSON を出力する何らかの処理を実行する
copy = JSON::State.from_state(json... -
JSON
. # generate(object , state = nil) -> String (3206.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
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... -
JSON
. # unparse(object , state = nil) -> String (3206.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
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...