るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. array fill
  2. array []
  3. array sample
  4. array new
  5. array []=

クラス

キーワード

検索結果

JSON::State#array_nl -> String (18367.0)

JSON の配列の後に出力する文字列を返します。

...
JSON
の配列の後に出力する文字列を返します。

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

json
_state = JSON::State.new({})
json
_state.array_nl # => ""
json
_state = JSON::State.new(array_nl: "\n")
json
_state.array_nl # => "\n"
//}...

JSON::State#array_nl=(str) (18367.0)

JSON の配列の後に出力する文字列をセットします。

...
JSON
の配列の後に出力する文字列をセットします。

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

json
_state = JSON::State.new({})
json
_state.array_nl # => ""
json
_state.array_nl = "\n"
json
_state.array_nl # => "\n"
//}...

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (9010.0)

自身から生成した JSON 形式の文字列を返します。

...自身から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash を...
...指定します。

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

[1, 2, 3].to_json # => "[1,2,3]"
//}...

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,...

絞り込み条件を変える