るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. _builtin each_object
  2. objectspace each_object
  3. json object
  4. object send
  5. object to_enum

ライブラリ

キーワード

検索結果

JSON::State#object_nl -> String (18379.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。

.../emlist[例][ruby]{
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 = JSON::State.new(object_nl: "\n")
json_state.object_nl...

JSON::State#object_nl=(string) (18379.0)

JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。

...れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。

//emlist[例][ruby]{
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,{"nam...

JSON::State#[](name) -> object (307.0)

Return the value returned by method name.

Return the value returned by method name.

JSON::State#generate(obj) -> String (52.0)

Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.

Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception.

JSON::State#to_h -> Hash (22.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 (22.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.new(options = {}) -> JSON::State (22.0)

自身を初期化します。

...by]{
require "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 # =...