11件ヒット
[1-11件を表示]
(0.286秒)
検索結果
-
JSON
. create _ id -> String (18220.0) -
json_create メソッドで使用するクラスを決定するために使用する値を返します。
...ate(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\...