ライブラリ
- ビルトイン (26)
- json (1155)
-
json
/ add / bigdecimal (22) -
json
/ add / complex (22) -
json
/ add / date (22) -
json
/ add / date _ time (22) -
json
/ add / exception (22) -
json
/ add / ostruct (22) -
json
/ add / range (22) -
json
/ add / rational (22) -
json
/ add / regexp (22) -
json
/ add / struct (22) -
json
/ add / symbol (22) -
json
/ add / time (22) -
json
/ editor (11) - psych (11)
-
rdoc
/ generator / json _ index (44)
クラス
- BigDecimal (22)
- Class (11)
- Complex (22)
- Date (22)
- DateTime (22)
- Exception (22)
-
JSON
:: Parser (33) -
JSON
:: State (341) - Object (26)
- OpenStruct (22)
-
RDoc
:: Generator :: JsonIndex (33) - Range (22)
- Rational (22)
- Regexp (22)
- Struct (22)
- Symbol (22)
- Time (22)
モジュール
- JSON (253)
-
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)
キーワード
- Array (22)
- CircularDatastructure (11)
- Editor (11)
- Extend (22)
- FalseClass (22)
- Float (22)
- GeneratorError (11)
- Hash (22)
- Infinity (11)
- Integer (22)
- JSON (22)
- JSONError (11)
-
JSON
_ LOADED (11) - JsonIndex (11)
- MinusInfinity (11)
- MissingUnicodeSupport (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NaN (11)
- NestingError (11)
- NilClass (22)
- Object (22)
- Parser (22)
- ParserError (11)
-
SEARCH
_ INDEX _ FILE (11) - State (22)
- String (22)
- TrueClass (22)
- UnparserError (11)
-
VARIANT
_ BINARY (11) - VERSION (11)
- [] (22)
- []= (11)
-
allow
_ nan? (11) -
array
_ nl (11) -
array
_ nl= (11) -
ascii
_ only? (11) -
buffer
_ initial _ length (11) -
buffer
_ initial _ length= (11) -
check
_ circular? (11) - configure (11)
-
create
_ id (11) -
create
_ id= (11) - depth (11)
- depth= (11)
- dump (11)
-
fast
_ generate (11) -
fast
_ unparse (11) -
from
_ state (11) - generate (33)
- generator (11)
- indent (11)
- indent= (11)
- j (11)
- jj (11)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / core (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) -
json
/ editor (11) -
json
_ creatable? (11) -
json
_ create (143) - load (11)
-
max
_ nesting (11) -
max
_ nesting= (11) - merge (11)
- new (33)
-
object
_ nl (11) -
object
_ nl= (11) - parse (22)
- parse! (11)
- parser (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
quirks
_ mode (11) -
quirks
_ mode= (11) -
quirks
_ mode? (11) -
rdoc
/ generator / json _ index (11) - restore (11)
- source (11)
- space (11)
- space= (11)
-
space
_ before (11) -
space
_ before= (11) - state (11)
- then (12)
-
to
_ h (11) -
to
_ hash (11) -
to
_ json (242) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) - unparse (11)
-
yield
_ self (14)
検索結果
先頭5件
-
json (38082.0)
-
JSON (JavaScript Object Notation)を扱うライブラリです。
...JSON (JavaScript Object Notation)を扱うライブラリです。
このライブラリでは、JSON モジュールに JSON を操作するための代表的なメソッドが集められています。
詳細は JSON モジュールを参照してください。
JSON の仕様は 7159 を参照......][ruby]{
require "json"
# JSON文字列をRubyのオブジェクトに変換する
json_str = '{"name": "Ruby", "age": 30}'
JSON.parse(json_str) # => {"name"=>"Ruby", "age"=>30}
# RubyのオブジェクトをJSON文字列に変換する
data = {"name" => "Ruby", "age" => 30}
JSON.dump(data) # => "... -
JSON
:: JSON _ LOADED -> bool (23117.0) -
JSON ライブラリがロード済みである場合に真を返します。 そうでない場合は偽を返します。
...
JSON ライブラリがロード済みである場合に真を返します。
そうでない場合は偽を返します。... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw -> String (17189.0) -
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
...自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (17165.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
...した結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字......をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
class Person
attr :name, :age
def initialize(name, ag......e)
@name, @age = name, age
end
end
tanaka = Person.new("tanaka", 29)
tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (17165.0) -
自身から生成した JSON 形式の文字列を返します。
...ら生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字......に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
puts "test".to_json # => "test"
puts '"'.to_json #......=> "\""
puts "\\".to_json # => "\\"
puts "𤘩宮城".to_json(ascii_only: true) # => "\ud851\ude29\u5bae\u57ce"
//}... -
JSON
. # generate(object , state = nil) -> String (17160.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...オブジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成する......こともありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定で......tring that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環... -
JSON
. # unparse(object , state = nil) -> String (17160.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...オブジェクトを一行の JSON 形式の文字列に変換して返します。
デフォルトでは、サイズが最小となる JSON 形式の文字列を生成します。
また、循環参照のチェックを行います。JSON::NaN, JSON::Infinity,
JSON::MinusInfinity を生成する......こともありません。
unparse は将来削除される予定です。
@param object JSON 形式の文字列に変換するオブジェクトを指定します。
@param state JSON::State または、to_hash や to_h メソッドでハッシュに変換可能なオブジェクトを指定で......tring that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a JSON array (default: '')
: :check_circular
真を指定した場合、生成するオブジェクトの循環... -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (17147.0) -
自身から生成した JSON 形式の文字列を返します。
...自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を......指定します。
//emlist[例][ruby]{
require "json"
[1, 2, 3].to_json # => "[1,2,3]"
//}... -
JSON
:: Generator :: GeneratorMethods :: FalseClass # to _ json(state _ or _ hash = nil) -> String (17147.0) -
自身から生成した JSON 形式の文字列を返します。
...ら生成した JSON 形式の文字列を返します。
"false" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new......の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
false.to_json # => "false"
//}... -
JSON
:: Generator :: GeneratorMethods :: Float # to _ json(state _ or _ hash = nil) -> String (17147.0) -
自身から生成した JSON 形式の文字列を返します。
...自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を......指定します。
//emlist[例][ruby]{
require "json"
(1.0).to_json # => "1.0"
//}...