るりまサーチ

最速Rubyリファレンスマニュアル検索!
275件ヒット [201-275件を表示] (0.045秒)
トップページ > クエリ:String[x] > クエリ:to_json[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

検索結果

<< < 1 2 3 >>

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

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

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

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

10.to_json # => "10"
//}...

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

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

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

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

nil.to_json # => "null"
//}...

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

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

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

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

true.to_json # => "true"
//}...

Psych.to_json(o) -> String (18202.0)

Ruby のオブジェクト o を JSON の文字列に変換します。

Ruby のオブジェクト o を JSON の文字列に変換します。

@param o 変換対象となるオブジェクト

JSON::Generator::GeneratorMethods::String#to_json_raw -> String (9268.0)

自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。

...自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。

@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json...

絞り込み条件を変える

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

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

...する場合に使用してください。

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::GeneratorError)...

JSON.create_id -> String (113.0)

json_create メソッドで使用するクラスを決定するために使用する値を返します。

...me"])
end

def as_json(*)
{
JSON.create_id => self.class.name,
"id" => id,
"name" => name,
}
end

def to_json(*)
as_json.to_json
end
end

json = JSON.generate(User.new(1, "tanaka"))
json # => "{\"json_class\":\"User\",\"id\":1,\"name\":\"tanaka\"}"
JSON.parse(...
<< < 1 2 3 >>