るりまサーチ (Ruby 2.4.0)

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

別のキーワード

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

ライブラリ

モジュール

検索結果

JSON.create_id -> String (54625.0)

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

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

デフォルトは "json_class" です。

//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(*)
{
...