837件ヒット
[1-100件を表示]
(0.147秒)
種類
- インスタンスメソッド (487)
- 特異メソッド (154)
- モジュール関数 (121)
- 定数 (55)
- 文書 (20)
ライブラリ
- ビルトイン (14)
- json (561)
-
json
/ add / bigdecimal (22) -
json
/ add / complex (22) -
json
/ add / date (11) -
json
/ add / date _ time (22) -
json
/ add / exception (22) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (22) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (22) - psych (11)
-
rdoc
/ generator / json _ index (33)
クラス
- BigDecimal (22)
- Complex (22)
- Date (11)
- DateTime (22)
- Exception (22)
-
JSON
:: Parser (22) -
JSON
:: State (187) - Object (14)
- OpenStruct (11)
-
RDoc
:: Generator :: JsonIndex (33) - Range (11)
- Rational (22)
- Regexp (11)
- Struct (11)
- Symbol (11)
- Time (22)
モジュール
- JSON (187)
-
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 (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kernel (33)
- Psych (11)
キーワード
- Infinity (11)
- MinusInfinity (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
SEARCH
_ INDEX _ FILE (11) -
VARIANT
_ BINARY (11) - VERSION (11)
- [] (11)
-
array
_ nl (11) -
ascii
_ only? (11) -
buffer
_ initial _ length (11) -
check
_ circular? (11) - configure (11)
-
create
_ id (11) - depth (11)
- dump (11)
-
fast
_ generate (11) -
fast
_ unparse (11) -
from
_ state (11) - generate (33)
- indent (11)
- j (11)
- jj (11)
-
json
_ create (77) - load (11)
-
max
_ nesting (11) - merge (11)
- new (33)
-
object
_ nl (11) - parse (11)
- parse! (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
quirks
_ mode (11) -
quirks
_ mode? (11) - restore (11)
- source (11)
- space (11)
-
space
_ before (11) -
to
_ json (242) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) - unparse (11)
-
yield
_ self (14)
検索結果
先頭5件
-
JSON
:: MinusInfinity -> Float (39400.0) -
負の無限大を表します。
負の無限大を表します。
@see Float -
JSON
:: Infinity -> Float (33300.0) -
正の無限大を表します。
正の無限大を表します。
@see Float -
JSON
. create _ id -> String (27300.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">
//}... -
JSON
:: VERSION -> String (27201.0) -
このライブラリのバージョンを表す文字列です。
このライブラリのバージョンを表す文字列です。 -
JSON
:: VARIANT _ BINARY -> bool (27200.0) -
拡張ライブラリ版を使用している場合に真を返します。 そうでない場合は偽を返します。
拡張ライブラリ版を使用している場合に真を返します。
そうでない場合は偽を返します。 -
JSON
. # generate(object , state = nil) -> String (21360.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put... -
JSON
. # unparse(object , state = nil) -> String (21360.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...ジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成すること......もありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定できま......: :indent
インデントに使用する文字列を指定します。デフォルトは空文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (21352.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...オブジェクトを JSON 形式の文字列に変換してダンプします。
与えられたオブジェクトを引数として JSON.#generate を呼び出します。
@param object ダンプするオブジェクトを指定します。
@param io IO のように write メソッドを実......す。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。
@raise ArgumentError オブジェクトのネストの深さが limit を越えた場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.dump({ name: "tanak......) # => "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit (ArgumentError)
end
//}
@see Marshal, Marshal.#du... -
JSON
. # load(source , proc = nil , options = {}) -> object (21312.0) -
与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。
... JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。
proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。
require 'json'
str=<<JSON
[1,2,3]
JSON......
JSON.load(str) # => [1,2,3]
JSON.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]
str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON
JSON.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}......3
# {"a"=>1, "b"=>2, "c"=>3}
@param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。
@param proc Proc オブジェクトを指定します。
@param options オプションをハッシュで指定... -
JSON
. # parse!(source , options = {}) -> object (21312.0) -
与えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。
...えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。
JSON.#parse よりも危険なデフォルト値が指定されているので
信頼できる文字列のみを入力として使用するようにしてください。
@param source JSON 形式の文字......列を指定します。
@param options オプションをハッシュで指定します。
指定可能なオプションは以下の通りです。
: :max_nesting
入れ子になっているデータの最大の深さを指定します。
数値を指定すると深さのチェック......定すると 4627 を無視してパース時に JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を許可するようになります。デフォルトは真です。
: :create_additions
偽を指定するとマッチするクラスや JSON.create_id が見つかっても付加情報を生成し...