99件ヒット
[1-99件を表示]
(0.129秒)
ライブラリ
- json (33)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / rational (11) -
json
/ add / time (11)
モジュール
キーワード
-
create
_ id (11) -
create
_ id= (11)
検索結果
先頭5件
-
JSON
:: Generator :: GeneratorMethods :: String :: Extend . json _ create(hash) -> String (21207.0) -
JSON のオブジェクトから Ruby の文字列を生成して返します。
...のオブジェクトから Ruby の文字列を生成して返します。
@param hash キーとして "raw" という文字列を持ち、その値として数値の配列を持つハッシュを指定します。
require 'json'
String.json_create({"raw" => [0x41, 0x42, 0x43]}) # => "ABC"... -
BigDecimal
. json _ create(hash) -> BigDecimal (21201.0) -
JSON のオブジェクトから BigDecimal のオブジェクトを生成して返します。
...JSON のオブジェクトから BigDecimal のオブジェクトを生成して返します。
@param hash Marshal.#load 可能な値をキー 'b' に持つハッシュを指定します。... -
DateTime
. json _ create(hash) -> DateTime (21201.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。 -
Exception
. json _ create(hash) -> Exception (21201.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。 -
Rational
. json _ create(hash) -> Rational (21201.0) -
JSON のオブジェクトから Rational のオブジェクトを生成して返します。
...JSON のオブジェクトから Rational のオブジェクトを生成して返します。
@param hash 分子をキー 'n'、分母をキー 'd' に持つハッシュを指定します。... -
Time
. json _ create(hash) -> Time (21201.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。 -
Complex
. json _ create(hash) -> Complex (18107.0) -
JSON のオブジェクトから Complex のオブジェクトを生成して返します。
...JSON のオブジェクトから Complex のオブジェクトを生成して返します。
@param hash 実部をキー 'r'、虚部をキー 'i' に持つハッシュを指定します。... -
JSON
. create _ id=(identifier) (6216.0) -
json_create メソッドで使用するクラスを決定するために使用する値をセットします。
...
json_create メソッドで使用するクラスを決定するために使用する値をセットします。
@param identifier 識別子を指定します。
//emlist[例][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_json # => {"my_json_class":"Range","a":[1,5,false]}
//}... -
JSON
. create _ id -> String (6122.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(......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,\"nam......e\":\"tanaka\"}"
JSON.parse(json, create_additions: true)
# => #<User:0x0000557709b269e0 @id=1, @name="tanaka">
//}...