231件ヒット
[201-231件を表示]
(0.161秒)
別のキーワード
種類
- インスタンスメソッド (220)
- 特異メソッド (11)
ライブラリ
- json (121)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / time (11)
クラス
モジュール
- JSON (11)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (22) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11)
キーワード
-
create
_ id (11) -
to
_ json _ raw _ object (11)
検索結果
先頭3件
-
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (18313.0) -
自身から生成した JSON 形式の文字列を返します。
...る JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//}... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw _ object -> Hash (9237.0) -
生の文字列を格納したハッシュを生成します。
...TF-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::GeneratorError)... -
JSON
. create _ id -> String (6218.0) -
json_create メソッドで使用するクラスを決定するために使用する値を返します。
...。
//emlist[例][ruby]{
require "json"
class User
attr :id, :name
def initialize(id, name)
@id, @name = id, name
end
def self.json_create(object)
new(object['id'], object["name"])
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(json, create_additions: true)
# => #<User:0x0000557709b269e0 @id=1, @name="tanaka">
//}...