るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.191秒)
トップページ > クエリ:-[x] > クエリ:E[x] > クエリ:space_before[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. open3 capture2e
  5. matrix rank_e

ライブラリ

クラス

モジュール

キーワード

検索結果

JSON::State#space_before -> String (24325.0)

JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。

...emlist[例][ruby]{
require "json"

json_state = JSON::State.new(space_before: "")
json_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]

json_state = JSON::State.new(space_before: " ")
json_state.space_be...
...fore # => " "
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name" :"tanaka","age" :19}]
//}...

JSON.#generate(object, state = nil) -> String (6206.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...JSON::MinusInfinity を生成することもありません。

unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブジェクトを指定します。

@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可...
...dent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :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 at the...
...end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環をチェックします。
この動作がデフォルトです。
: :allow_nan
真を指定し...

JSON.#unparse(object, state = nil) -> String (6206.0)

与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。

...JSON::MinusInfinity を生成することもありません。

unparse は将来削除される予定です。

@param object JSON 形式の文字列に変換するオブジェクトを指定します。

@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可...
...dent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :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 at the...
...end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環をチェックします。
この動作がデフォルトです。
: :allow_nan
真を指定し...

JSON::State.new(options = {}) -> JSON::State (6206.0)

自身を初期化します。

...りです。

: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
JSON 形式の文字列のトークン間に挿入する文字列を指定します。デフォルトは空文字列です。
: :space_before
JSON 形式の文...
...オブジェクトを表す部分にある ':' の
前に挿入する文字列をセットします。デフォルトは空文字列です。
: :object_nl
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
デフォル...
...の文字列中に現れる JavaScript の配列の行末に挿入する文字列を指定します。
デフォルトは空文字列です。
: :check_circular
真を指定した場合、生成するオブジェクトの循環をチェックします。
この動作がデフォルトです。...

JSON::State#to_h -> Hash (3106.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=>100,
# :depth=>0...
...,
# :buffer_initial_length=>1024}
//}...

絞り込み条件を変える

JSON::State#to_hash -> Hash (3106.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=>100,
# :depth=>0...
...,
# :buffer_initial_length=>1024}
//}...