るりまサーチ

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

別のキーワード

  1. net/http copy
  2. fileutils copy
  3. io copy_stream
  4. fileutils copy_file
  5. _builtin copy_stream

クラス

キーワード

検索結果

JSON::State.from_state(options) -> JSON::State (20.0)

与えられた options によって生成した JSON::State のインスタンスを返します。

...した JSON::State のインスタンスを返します。

@param options JSON::State のインスタンスか、ハッシュを指定します。

@return options がハッシュである場合は、それによって初期化した JSON::State を
返します。options が JSON::State...
...れていない JSON::State の
インスタンスを返します。

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

json
_state = JSON::State.from_state(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_state)
copy
.class # => JSON::Ext::Generator::State
copy
.indent # => "\t"
//}...

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

自身を初期化します。

...字列を指定します。デフォルトは空文字列です。
: :space
JSON
形式の文字列のトークン間に挿入する文字列を指定します。デフォルトは空文字列です。
: :space_before
JSON
形式の文字列中で JavaScript のオブジェクトを表す部分...
...。デフォルトは空文字列です。
: :object_nl
JSON
形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
デフォルトは空文字列です。
: :array_nl
JSON
形式の文字列中に現れる JavaScript の配列...
...re "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 # => JSON::Ex...