るりまサーチ

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

別のキーワード

  1. tempfile create
  2. resolv create
  3. registry create
  4. win32/registry create
  5. json create_id

ライブラリ

モジュール

検索結果

JSON.create_id -> String (18108.0)

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

...e)
@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(Us...

JSON.create_id=(identifier) (6120.0)

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

...][ruby]{
require "json"
require "json/add/core"

JSON.create_id # => "json_class"
puts (1..5).to_json # => {"json_class":"Range","a":[1,5,false]}
JSON.create_id = "my_json_class" # => "my_json_class"
JSON.create_id # => "my_json_class"
puts (1..5).to_...