ライブラリ
- ビルトイン (193)
- json (11)
-
net
/ pop (11) - openssl (11)
-
rexml
/ document (11)
クラス
-
Encoding
:: Converter (44) -
Enumerator
:: Lazy (51) -
JSON
:: State (11) - Module (5)
-
Net
:: POP3 (11) -
OpenSSL
:: X509 :: Certificate (11) - Proc (5)
-
REXML
:: Parent (11)
モジュール
- Enumerable (88)
キーワード
-
auth
_ only (11) -
chunk
_ while (19) -
each
_ entry (22) -
insert
_ before (11) -
not
_ before (11) -
primitive
_ convert (44) -
ruby2
_ keywords (10) -
slice
_ after (22) -
slice
_ before (55) -
slice
_ when (21) -
space
_ before (11)
検索結果
先頭5件
- REXML
:: Parent # insert _ before(child1 , child2) -> self - Enumerable
# slice _ before {|elt| bool } -> Enumerator - Enumerable
# slice _ before(pattern) -> Enumerator - Enumerator
:: Lazy # slice _ before {|elt| bool } -> Enumerator :: Lazy - Enumerator
:: Lazy # slice _ before(initial _ state) {|elt , state| bool } -> Enumerator :: Lazy
-
REXML
:: Parent # insert _ before(child1 , child2) -> self (18302.0) -
child2 を child1 で指定したノードの前に挿入します。
...ドの前に挿入します。
child1 が REXML::Child のインスタンスであるならば、その
子ノードの前に挿入されます。
child1 が 文字列であるならば、XPath で場所を指定します。
具体的には REXML::XPath.first(self, child1) で特定されるノー......ドの
前に挿入されます。
挿入されるノード(child2)の親は self に変更されます。
@param child1 挿入場所の指定
@param child2 挿入されるノード... -
Enumerable
# slice _ before {|elt| bool } -> Enumerator (12387.0) -
パターンがマッチした要素、もしくはブロックが真を返した要素から 次にマッチする手前までを チャンク化(グループ化)したものを繰り返す Enumerator を 返します。
...はブロックが真を返した要素から
次にマッチする手前までを
チャンク化(グループ化)したものを繰り返す Enumerator を
返します。
パターンを渡した場合は各要素に対し === が呼び出され、
それが真になったところをチャン......クは配列として表現されます。
Enumerable#to_a や Enumerable#map のようなメソッドを使うこ
ともできます。
//emlist[例][ruby]{
# 偶数要素をチャンクの先頭と見なす
[0,2,4,1,2,4,5,3,1,4,2].slice_before(&:even?).to_a
# => [[0], [2], [4, 1], [2], [4, 5, 3,......slice_before(&:odd?).to_a
# => [[0, 2, 4], [1, 2, 4], [5], [3], [1, 4, 2]]
# ChangeLog のエントリーを順に取る
open("ChangeLog") {|f|
f.slice_before(/\A\S/).each {|e| pp e}
}
# 上と同じだが、パターンでなくブロックを使う
open("ChangeLog") {|f|
f.slice_before {|lin... -
Enumerable
# slice _ before(pattern) -> Enumerator (12387.0) -
パターンがマッチした要素、もしくはブロックが真を返した要素から 次にマッチする手前までを チャンク化(グループ化)したものを繰り返す Enumerator を 返します。
...はブロックが真を返した要素から
次にマッチする手前までを
チャンク化(グループ化)したものを繰り返す Enumerator を
返します。
パターンを渡した場合は各要素に対し === が呼び出され、
それが真になったところをチャン......クは配列として表現されます。
Enumerable#to_a や Enumerable#map のようなメソッドを使うこ
ともできます。
//emlist[例][ruby]{
# 偶数要素をチャンクの先頭と見なす
[0,2,4,1,2,4,5,3,1,4,2].slice_before(&:even?).to_a
# => [[0], [2], [4, 1], [2], [4, 5, 3,......slice_before(&:odd?).to_a
# => [[0, 2, 4], [1, 2, 4], [5], [3], [1, 4, 2]]
# ChangeLog のエントリーを順に取る
open("ChangeLog") {|f|
f.slice_before(/\A\S/).each {|e| pp e}
}
# 上と同じだが、パターンでなくブロックを使う
open("ChangeLog") {|f|
f.slice_before {|lin... -
Enumerator
:: Lazy # slice _ before {|elt| bool } -> Enumerator :: Lazy (12338.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 }.t......ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}
@see Enumerable#slice_before... -
Enumerator
:: Lazy # slice _ before(initial _ state) {|elt , state| bool } -> Enumerator :: Lazy (12338.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 }.t......ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}
@see Enumerable#slice_before... -
Enumerator
:: Lazy # slice _ before(pattern) -> Enumerator :: Lazy (12338.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 }.t......ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}
@see Enumerable#slice_before... -
JSON
:: State # space _ before -> String (12326.0) -
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の 前に挿入する文字列を返します。
...の文字列中で 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}]
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}]
//}... -
OpenSSL
:: X509 :: Certificate # not _ before -> Time (12302.0) -
証明書が有効になる時刻を返します。
証明書が有効になる時刻を返します。 -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (9219.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......tput before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_em... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9219.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...、Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_by......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......tput before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_em...