るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.015秒)
トップページ > クエリ:sh[x] > モジュール:JSON::Generator::GeneratorMethods::String[x]

別のキーワード

  1. rake sh
  2. fileutils sh
  3. _builtin lock_sh
  4. constants lock_sh
  5. sync sh

ライブラリ

キーワード

検索結果

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

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

...返すことがあります。

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

//emli...

JSON::Generator::GeneratorMethods::String#to_json_raw_object -> Hash (101.0)

生の文字列を格納したハッシュを生成します。

生の文字列を格納したハッシュを生成します。

このメソッドは UTF-8 の文字列ではなく生の文字列を JSON に変換する場合に使用してください。

require 'json'
"にほんご".encode("euc-jp").to_json_raw_object
# => {"json_class"=>"String", "raw"=>[164, 203, 164, 219, 164, 243, 164, 180]}
"にほんご".encode("euc-jp").to_json # source sequence is illegal/malformed (JSON::...