ライブラリ
- ビルトイン (4)
- json (107)
-
json
/ add / bigdecimal (2) -
json
/ add / complex (2) -
json
/ add / date (2) -
json
/ add / date _ time (2) -
json
/ add / exception (2) -
json
/ add / ostruct (2) -
json
/ add / range (2) -
json
/ add / rational (2) -
json
/ add / regexp (2) -
json
/ add / struct (2) -
json
/ add / symbol (2) -
json
/ add / time (2) -
json
/ editor (1) - psych (1)
-
rdoc
/ generator / json _ index (4)
クラス
- BigDecimal (2)
- Class (1)
- Complex (2)
- Date (2)
- DateTime (2)
- Exception (2)
-
JSON
:: Parser (3) -
JSON
:: State (31) - Object (4)
- OpenStruct (2)
-
RDoc
:: Generator :: JsonIndex (3) - Range (2)
- Rational (2)
- Regexp (2)
- Struct (2)
- Symbol (2)
- Time (2)
モジュール
- JSON (25)
-
JSON
:: Generator :: GeneratorMethods :: Array (1) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (1) -
JSON
:: Generator :: GeneratorMethods :: Float (1) -
JSON
:: Generator :: GeneratorMethods :: Hash (1) -
JSON
:: Generator :: GeneratorMethods :: Integer (1) -
JSON
:: Generator :: GeneratorMethods :: NilClass (1) -
JSON
:: Generator :: GeneratorMethods :: Object (1) -
JSON
:: Generator :: GeneratorMethods :: String (3) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (1) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1) - Kernel (3)
- Psych (1)
キーワード
- Array (2)
- CircularDatastructure (1)
- Editor (1)
- Extend (2)
- FalseClass (2)
- Float (2)
- GeneratorError (1)
- Hash (2)
- Infinity (1)
- Integer (2)
- JSONError (1)
-
JSON
_ LOADED (1) - JsonIndex (1)
- MinusInfinity (1)
- MissingUnicodeSupport (1)
-
NEWS for Ruby 2
. 0 . 0 (1) -
NEWS for Ruby 2
. 5 . 0 (1) - NaN (1)
- NestingError (1)
- NilClass (2)
- Object (2)
- Parser (2)
- ParserError (1)
-
SEARCH
_ INDEX _ FILE (1) - State (2)
- String (2)
- TrueClass (2)
- UnparserError (1)
-
VARIANT
_ BINARY (1) - VERSION (1)
- [] (2)
- []= (1)
-
allow
_ nan? (1) -
array
_ nl (1) -
array
_ nl= (1) -
ascii
_ only? (1) -
buffer
_ initial _ length (1) -
buffer
_ initial _ length= (1) -
check
_ circular? (1) - configure (1)
-
create
_ id (1) -
create
_ id= (1) - depth (1)
- depth= (1)
- dump (1)
-
fast
_ generate (1) -
fast
_ unparse (1) -
from
_ state (1) - generate (3)
- generator (1)
- indent (1)
- indent= (1)
- j (1)
- jj (1)
- json (1)
-
json
/ add / bigdecimal (1) -
json
/ add / complex (1) -
json
/ add / core (1) -
json
/ add / date (1) -
json
/ add / date _ time (1) -
json
/ add / exception (1) -
json
/ add / ostruct (1) -
json
/ add / range (1) -
json
/ add / rational (1) -
json
/ add / regexp (1) -
json
/ add / struct (1) -
json
/ add / symbol (1) -
json
/ add / time (1) -
json
/ editor (1) -
json
_ creatable? (1) -
json
_ create (13) - load (1)
-
load
_ file (1) -
load
_ file! (1) -
max
_ nesting (1) -
max
_ nesting= (1) - merge (1)
- new (3)
-
object
_ nl (1) -
object
_ nl= (1) - parse (2)
- parse! (1)
- parser (1)
-
pretty
_ generate (1) -
pretty
_ unparse (1) -
quirks
_ mode (1) -
quirks
_ mode= (1) -
quirks
_ mode? (1) -
rdoc
/ generator / json _ index (1) - restore (1)
- source (1)
- space (1)
- space= (1)
-
space
_ before (1) -
space
_ before= (1) - state (1)
- then (2)
-
to
_ h (1) -
to
_ hash (1) -
to
_ json (22) -
to
_ json _ raw (1) -
to
_ json _ raw _ object (1) - unparse (1)
-
yield
_ self (2)
検索結果
先頭5件
-
JSON
:: State # array _ nl=(str) (9157.0) -
JSON の配列の後に出力する文字列をセットします。
JSON の配列の後に出力する文字列をセットします。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new({})
json_state.array_nl # => ""
json_state.array_nl = "\n"
json_state.array_nl # => "\n"
//} -
JSON
:: State # allow _ nan? -> bool (9127.0) -
NaN, Infinity, -Infinity を生成できる場合、真を返します。 そうでない場合は偽を返します。
NaN, Infinity, -Infinity を生成できる場合、真を返します。
そうでない場合は偽を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new({})
json_state.allow_nan? # => false
json_state = JSON::State.new(allow_nan: true)
json_state.allow_nan? # => true
//}
@see 4627 -
JSON
:: State # indent -> String (9109.0) -
インデントに使用する文字列を返します。
インデントに使用する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//} -
JSON
:: State (9097.0) -
Ruby オブジェクトから JSON 形式の文字列を生成する間、 JSON 形式の文字列を生成するための設定を保持しておくために使用するクラスです。
Ruby オブジェクトから JSON 形式の文字列を生成する間、
JSON 形式の文字列を生成するための設定を保持しておくために使用するクラスです。 -
JSON
:: State # generate(obj) -> String (9097.0) -
Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.
Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception. -
JSON
:: State # to _ h -> Hash (9073.0) -
自身をハッシュに変換します。
自身をハッシュに変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# ... -
JSON
:: State # to _ hash -> Hash (9073.0) -
自身をハッシュに変換します。
自身をハッシュに変換します。
//emlist[例][ruby]{
require "json"
require "pp"
json_state = JSON::State.new
pp json_state.to_h
# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,
# :max_nesting=>100,
# ... -
JSON
:: Parser # parse -> object (9055.0) -
現在のソースをパースして結果を Ruby のオブジェクトとして返します。
現在のソースをパースして結果を Ruby のオブジェクトとして返します。
//emlist[例][ruby]{
require 'json'
class Person
attr_accessor :name, :age
def []=(key, value)
instance_variable_set("@#{key}", value)
end
end
parser = JSON::Parser.new(DATA.read, object_class: Person)
person = parser.parse
person.class # => Person
p... -
JSON
:: CircularDatastructure (9049.0) -
JSON 形式の文字列を生成するときに循環するデータ構造があるときに発生する例外です。
JSON 形式の文字列を生成するときに循環するデータ構造があるときに発生する例外です。 -
JSON
:: Ext :: Generator :: GeneratorMethods :: Array (9049.0) -
Alias of JSON::Generator::GeneratorMethods::Array
Alias of JSON::Generator::GeneratorMethods::Array -
JSON
:: Ext :: Generator :: GeneratorMethods :: FalseClass (9049.0) -
Alias of JSON::Generator::GeneratorMethods::FalseClass
Alias of JSON::Generator::GeneratorMethods::FalseClass -
JSON
:: Ext :: Generator :: GeneratorMethods :: Float (9049.0) -
Alias of JSON::Generator::GeneratorMethods::Float
Alias of JSON::Generator::GeneratorMethods::Float -
JSON
:: Ext :: Generator :: GeneratorMethods :: Hash (9049.0) -
Alias of JSON::Generator::GeneratorMethods::Hash
Alias of JSON::Generator::GeneratorMethods::Hash -
JSON
:: Ext :: Generator :: GeneratorMethods :: Integer (9049.0) -
Alias of JSON::Generator::GeneratorMethods::Integer
Alias of JSON::Generator::GeneratorMethods::Integer -
JSON
:: Ext :: Generator :: GeneratorMethods :: NilClass (9049.0) -
Alias of JSON::Generator::GeneratorMethods::NilClass
Alias of JSON::Generator::GeneratorMethods::NilClass -
JSON
:: Ext :: Generator :: GeneratorMethods :: Object (9049.0) -
Alias of JSON::Generator::GeneratorMethods::Object
Alias of JSON::Generator::GeneratorMethods::Object -
JSON
:: Ext :: Generator :: GeneratorMethods :: String (9049.0) -
Alias of JSON::Generator::GeneratorMethods::String
Alias of JSON::Generator::GeneratorMethods::String -
JSON
:: Ext :: Generator :: GeneratorMethods :: String :: Extend (9049.0) -
Alias of JSON::Generator::GeneratorMethods::String::Extend
Alias of JSON::Generator::GeneratorMethods::String::Extend -
JSON
:: Ext :: Generator :: GeneratorMethods :: TrueClass (9049.0) -
Alias of JSON::Generator::GeneratorMethods::TrueClass
Alias of JSON::Generator::GeneratorMethods::TrueClass -
JSON
:: Ext :: Generator :: State (9049.0) -
Alias of JSON::State
Alias of JSON::State -
JSON
:: Ext :: Parser (9049.0) -
Alias of JSON::Parser
Alias of JSON::Parser -
JSON
:: Generator :: GeneratorMethods :: Array (9049.0) -
Array に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
Array に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: FalseClass (9049.0) -
FalseClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
FalseClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: Float (9049.0) -
Float に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
Float に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: Hash (9049.0) -
Hash に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
Hash に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: Integer (9049.0) -
Integer に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
Integer に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: NilClass (9049.0) -
NilClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
NilClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: Object (9049.0) -
Object に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
Object に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: String (9049.0) -
String に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
String に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (9049.0) -
String に JSON で使用する特異メソッドを追加するためのモジュールです。
String に JSON で使用する特異メソッドを追加するためのモジュールです。 -
JSON
:: Generator :: GeneratorMethods :: TrueClass (9049.0) -
TrueClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。
TrueClass に JSON で使用するインスタンスメソッドを追加するためのモジュールです。 -
JSON
:: GeneratorError (9049.0) -
JSON 形式の文字列を生成するときに発生したエラーを通知する例外です。
JSON 形式の文字列を生成するときに発生したエラーを通知する例外です。 -
JSON
:: ParserError (9049.0) -
JSON のパースエラーを通知する例外です。
JSON のパースエラーを通知する例外です。 -
JSON
:: State # ascii _ only? -> bool (9049.0) -
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。 そうでない場合に偽を返します。
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。
そうでない場合に偽を返します。 -
JSON
:: State # depth=(depth) (9049.0) -
This sets the maximum level of data structure nesting in the generated JSON to the integer depth, max_nesting = 0 if no maximum should be checked.
This sets the maximum level of data structure nesting in the generated
JSON to the integer depth, max_nesting = 0 if no maximum should be
checked. -
JSON
:: UnparserError (9049.0) -
Alias of JSON::GeneratorError
Alias of JSON::GeneratorError -
JSON
:: Parser # source -> String (9037.0) -
現在のソースのコピーを返します。
現在のソースのコピーを返します。
//emlist[例][ruby]{
require 'json'
parser = JSON::Parser.new(DATA.read)
print parser.source
# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
# => }
__END__
{
"Tanaka": {
... -
JSON
:: Editor (9001.0) -
-
JSON
:: MissingUnicodeSupport (9001.0) -
要求されたユニコードサポートがシステムにインストールされていない場合に発生する例外です。 通常、これは iconv がインストールされていないことを意味します。
要求されたユニコードサポートがシステムにインストールされていない場合に発生する例外です。
通常、これは iconv がインストールされていないことを意味します。 -
JSON
:: NestingError (9001.0) -
パースしようとしているデータ構造のネストが深すぎる場合に発生する例外です。
パースしようとしているデータ構造のネストが深すぎる場合に発生する例外です。 -
JSON
:: Parser (9001.0) -
-
JSON
:: State # [](name) -> object (9001.0) -
Return the value returned by method name.
Return the value returned by method name. -
JSON
:: State # []=(name , value) (9001.0) -
Set the attribute name to value.
Set the attribute name to value. -
JSON
:: State # buffer _ initial _ length -> Integer (9001.0) -
This integer returns the current initial length of the buffer.
This integer returns the current initial length of the buffer. -
JSON
:: State # buffer _ initial _ length=(length) (9001.0) -
This sets the initial length of the buffer to length, if length > 0, otherwise its value isn't changed.
This sets the initial length of the buffer to length, if length > 0,
otherwise its value isn't changed. -
JSON
:: State # depth -> Integer (9001.0) -
This integer returns the current depth of data structure nesting.
This integer returns the current depth of data structure nesting. -
JSON
:: State # quirks _ mode -> bool (9001.0) -
Returns true, if quirks mode is enabled. Otherwise returns false.
Returns true, if quirks mode is enabled. Otherwise returns false. -
JSON
:: State # quirks _ mode=(enable) (9001.0) -
If set to true, enables the quirks_mode mode.
If set to true, enables the quirks_mode mode. -
JSON
:: State # quirks _ mode? -> bool (9001.0) -
Returns true, if quirks mode is enabled. Otherwise returns false.
Returns true, if quirks mode is enabled. Otherwise returns false. -
RDoc
:: Generator :: JsonIndex # generate -> () (9001.0) -
解析した情報を RDoc::Generator::JsonIndex::SEARCH_INDEX_FILE に出 力します。
解析した情報を RDoc::Generator::JsonIndex::SEARCH_INDEX_FILE に出
力します。 -
RDoc
:: Generator :: JsonIndex :: SEARCH _ INDEX _ FILE -> String (9001.0) -
検索インデックスのパスを表す文字列です。
検索インデックスのパスを表す文字列です。 -
Kernel
# j(*objects) -> nil (85.0) -
与えられたオブジェクトを JSON 形式の文字列で標準出力に一行で出力します。
与えられたオブジェクトを JSON 形式の文字列で標準出力に一行で出力します。
@param objects JSON 形式で出力したいオブジェクトを指定します。
//emlist[例][ruby]{
require "json"
j([1,2,{"name" => "tanaka","age" => 19}])
# => [1,2,{"name":"tanaka","age":19}]
//}
@see Kernel.#p -
Kernel
# jj(*objects) -> nil (85.0) -
与えられたオブジェクトを JSON 形式の文字列で標準出力に人間に読みやすく整形して出力します。
与えられたオブジェクトを JSON 形式の文字列で標準出力に人間に読みやすく整形して出力します。
@param objects JSON 形式で出力したいオブジェクトを指定します。
//emlist[例][ruby]{
require "json"
jj([1,2,{"name" => "tanaka","age" => 19}])
# => [
# 1,
# 2,
# {
# "name": "tanaka",
# "age": 19
# }
# ]
//}
@see Kernel.#pp -
Object
# then -> Enumerator (37.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
... -
Object
# then {|x| . . . } -> object (37.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
... -
Object
# yield _ self -> Enumerator (37.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
... -
Object
# yield _ self {|x| . . . } -> object (37.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
self を引数としてブロックを評価し、ブロックの結果を返します。
//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}
値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。
//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
... -
NEWS for Ruby 2
. 0 . 0 (19.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に似ています)
* デフォルトのソースエンコーディングを US-ASCI... -
NEWS for Ruby 2
. 5 . 0 (19.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.5.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.4.0 以降の変更
=== 言語仕様の変更
* トップレベルの定数参照を削除しました 11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展...