るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.013秒)

別のキーワード

  1. json space_before
  2. state space_before
  3. json space_before=
  4. state space_before=
  5. state space

クラス

キーワード

検索結果

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

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

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

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

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

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#space_before=(string) (18385.0)

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

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

@param string JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列...
...uire "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.space_before = " "
json
_state.space_before # => " "
puts JSON.gene...
...rate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name" :"tanaka","age" :19}]
//}...

JSON::State#to_h -> Hash (28.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,...

JSON::State#to_hash -> Hash (28.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,...