るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.031秒)
トップページ > クエリ:new[x] > クエリ:length[x] > クラス:JSON::State[x]

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

キーワード

検索結果

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

自身を初期化します。

...uffer_initial_length
sets the initial length of the generator's internal buffer.

//emlist[例 Hash を指定][ruby]{
require "json"

json_state = JSON::State.new(indent: "\t")
json_state.class # => JSON::Ext::Generator::State
json_state.indent # => "\t"
//}

//emlist[例 JSON::State を指定][r...
...uby]{
require "json"

json_state = JSON::State.new(indent: "\t")
copy = JSON::State.new(json_state)
copy.class # => JSON::Ext::Generator::State
copy.indent # => "\t"
//}...

JSON::State#to_h -> Hash (13.0)

自身をハッシュに変換します。

...quire "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 (13.0)

自身をハッシュに変換します。

...quire "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}
//}...