ライブラリ
- ビルトイン (6)
- json (24)
- openssl (1)
-
ripper
/ lexer (2) -
rubygems
/ user _ interaction (4)
クラス
-
Encoding
:: Converter (1) -
Enumerator
:: Lazy (4) -
Gem
:: StreamUI (4) -
JSON
:: State (15) -
OpenSSL
:: SSL :: SSLSocket (1) - Random (1)
-
Ripper
:: Lexer (2)
モジュール
-
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 (1) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1)
キーワード
- alert (1)
-
alert
_ error (1) -
alert
_ warning (1) -
array
_ nl (1) -
ascii
_ only? (1) -
buffer
_ initial _ length (1) -
check
_ circular? (1) - chunk (1)
- configure (1)
- depth (1)
- generate (1)
- indent (1)
-
insert
_ output (1) - lex (1)
-
max
_ nesting (1) - merge (1)
-
object
_ nl (1) - parse (1)
-
quirks
_ mode (1) -
quirks
_ mode? (1) - say (1)
-
slice
_ before (3) - space (1)
-
space
_ before (1) -
to
_ json (9)
検索結果
先頭5件
-
OpenSSL
:: SSL :: SSLSocket # state -> String (73207.0) -
現在の状態をアルファベット 6 文字の文字列で返します。
現在の状態をアルファベット 6 文字の文字列で返します。 -
Random
# state -> Integer (73207.0) -
C言語レベルで定義されている構造体MTの状態を参照します。詳しくはrandom.c を参照してください。
C言語レベルで定義されている構造体MTの状態を参照します。詳しくはrandom.c を参照してください。 -
Encoding
:: Converter # insert _ output(string) -> nil (46438.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換器内のバッファに文字列を挿入します。
バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換先がステートフルなエンコーディングであった場合、
挿入された文字列は状態に基づいて変換され、状態を更新します。
このメソッドは変換に際してエラーが発生した際にのみ利用されるべきです。
@param string 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.... -
JSON
:: State # max _ nesting -> Integer (46366.0) -
生成される JSON 形式の文字列のネストの深さの最大値を返します。
生成される JSON 形式の文字列のネストの深さの最大値を返します。
この値がゼロである場合は、ネストの深さのチェックを行いません。
//emlist[例 ネストの深さチェックを行う][ruby]{
require "json"
json_state = JSON::State.new(max_nesting: 2)
json_state.max_nesting # => 2
JSON.generate([[]], json_state)
JSON.generate([[[]]], json_state) # => JSON::NestingError
//}
... -
JSON
:: State # indent -> String (46348.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
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (46297.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]... -
JSON
:: Generator :: GeneratorMethods :: Integer # to _ json(state _ or _ hash = nil) -> String (46261.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
10.to_json # => "10"
//} -
JSON
:: Generator :: GeneratorMethods :: NilClass # to _ json(state _ or _ hash = nil) -> String (46261.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"null" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
nil.to_json # => "null"
//} -
JSON
:: State # buffer _ initial _ length -> Integer (46204.0) -
This integer returns the current initial length of the buffer.
This integer returns the current initial length of the buffer. -
Gem
:: StreamUI # alert _ warning(statement , question = nil) -> String | nil (37504.0) -
WARNING レベルのアラートを表示します。
WARNING レベルのアラートを表示します。
@param statement 表示する文字列を指定します。
@param question 必要であれば質問を指定します。
@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。
@see Gem::StreamUI#ask -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (37261.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 (37261.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 (37261.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
(1.0).to_json # => "1.0"
//} -
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (37261.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
person = { "name" => "tanaka", "age" => 19 }
person.to_json # ... -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (37261.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby... -
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (37261.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//} -
JSON
:: State # configure(options = {}) -> self (37138.0) -
与えられたハッシュで自身を設定します。
与えられたハッシュで自身を設定します。
オプションで使用するハッシュのキーについては JSON::State.new を参照してください。
@param options このオブジェクトの設定をするためのハッシュを指定します。
//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\... -
JSON
:: State # check _ circular? -> bool (36640.0) -
循環参照のチェックを行う場合は、真を返します。 そうでない場合は偽を返します。
循環参照のチェックを行う場合は、真を返します。
そうでない場合は偽を返します。
//emlist[例 ネストをチェックするケース][ruby]{
require "json"
a = [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]... -
JSON
:: State # ascii _ only? -> bool (36604.0) -
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。 そうでない場合に偽を返します。
ASCII 文字列のみを用いて JSON 形式の文字列を生成する場合に真を返します。
そうでない場合に偽を返します。 -
JSON
:: State # quirks _ mode -> bool (36604.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? -> bool (36604.0) -
Returns true, if quirks mode is enabled. Otherwise returns false.
Returns true, if quirks mode is enabled. Otherwise returns false. -
Enumerator
:: Lazy # slice _ before(initial _ state) {|elt , state| bool } -> Enumerator :: Lazy (28510.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
Gem
:: StreamUI # alert(statement , question = nil) -> String | nil (28204.0) -
INFO レベルのアラートを表示します。
INFO レベルのアラートを表示します。
@param statement 表示する文字列を指定します。
@param question 必要であれば質問を指定します。
@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。
@see Gem::StreamUI#ask -
Gem
:: StreamUI # alert _ error(statement , question = nil) -> String | nil (28204.0) -
ERROR レベルのアラートを表示します。
ERROR レベルのアラートを表示します。
@param statement 表示する文字列を指定します。
@param question 必要であれば質問を指定します。
@return question を指定した場合は、それに対する回答を返します。
question を指定しない場合は nil を返します。
@see Gem::StreamUI#ask -
JSON
:: State # merge(options = {}) -> self (28138.0) -
与えられたハッシュで自身を設定します。
与えられたハッシュで自身を設定します。
オプションで使用するハッシュのキーについては JSON::State.new を参照してください。
@param options このオブジェクトの設定をするためのハッシュを指定します。
//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\... -
JSON
:: State # object _ nl -> String (28048.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON:... -
Enumerator
:: Lazy # slice _ before {|elt| bool } -> Enumerator :: Lazy (27910.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
Enumerator
:: Lazy # slice _ before(pattern) -> Enumerator :: Lazy (27910.0) -
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>
1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6... -
JSON
:: State # depth -> Integer (27904.0) -
This integer returns the current depth of data structure nesting.
This integer returns the current depth of data structure nesting. -
JSON
:: State # generate(obj) -> String (27904.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 # space -> String (19084.0) -
JSON 形式の文字列のトークン間に挿入する文字列を返します。
JSON 形式の文字列のトークン間に挿入する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(space: "")
json_state.space # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
json_state = JSON::State.new(space: "\t")
json_... -
JSON
:: State # space _ before -> String (19048.0) -
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の
前に挿入する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(space_before: "")
json_state.space_before # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state)
# => [1,2,{"name":"tanaka","age":19}]
js... -
JSON
:: State # array _ nl -> String (19012.0) -
JSON の配列の後に出力する文字列を返します。
JSON の配列の後に出力する文字列を返します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new({})
json_state.array_nl # => ""
json_state = JSON::State.new(array_nl: "\n")
json_state.array_nl # => "\n"
//} -
Gem
:: StreamUI # say(statement = & # 39;& # 39;) -> () (18904.0) -
与えられた文字列を表示します。
与えられた文字列を表示します。
@param statement 表示する文字列を指定します。 -
Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (11407.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
ライブラリ内部で使用します。 Ripper.lex を使用してください。 -
Ripper
:: Lexer # parse -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (11407.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。た だし Ripper::Lexer#lex と違い、結果をソートしません。
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。た
だし Ripper::Lexer#lex と違い、結果をソートしません。
ライブラリ内部で使用します。 -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (10510.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5...