るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
41件ヒット [1-41件を表示] (0.047秒)

別のキーワード

  1. csv force_quotes?
  2. lazy force
  3. _builtin force
  4. options force_output
  5. options force_update

検索結果

Enumerator::Lazy#force(*args) -> [object] (54331.0)

全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。

全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。

Enumerable#to_a のエイリアスです。

//emlist[例][ruby]{
1.step.lazy.take(10).force
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

1.step.lazy.take(10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}

String#force_encoding(encoding) -> self (18385.0)

文字列の持つエンコーディング情報を指定された encoding に変えます。

文字列の持つエンコーディング情報を指定された encoding に変えます。

このとき実際のエンコーディングは変換されず、検査もされません。
Array#pack などで得られたバイト列のエンコーディングを指定する時に使います。

@param encoding 変更するエンコーディング情報を表す文字列か Encoding オブジェクトを指定します。

//emlist[例][ruby]{
s = [164, 164, 164, 237, 164, 207].pack("C*")
p s.encoding #=> ASC...

Regexp#fixed_encoding? -> bool (118.0)

正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

正規表現が任意の ASCII 互換エンコーディングとマッチ可能な時に false を返します。

//emlist[例][ruby]{
# -*- coding:utf-8 -*-

r = /a/
r.fixed_encoding? # => false
r.encoding # => #<Encoding:US-ASCII>
r =~ "\u{6666} a" # => 2
r =~ "\xa1\...

Encoding::Converter#convert(source_string) -> String (82.0)

与えられた文字列を変換して、変換できた結果を返します。 引数の末尾の文字がバイト列の途中で終わっている場合、そのバイト列は変換器内に取り置かれます。 変換を終了させるには Encoding::Converter#finish を呼びます。

与えられた文字列を変換して、変換できた結果を返します。
引数の末尾の文字がバイト列の途中で終わっている場合、そのバイト列は変換器内に取り置かれます。
変換を終了させるには Encoding::Converter#finish を呼びます。

Encoding::Converter を用いると、文字列の一部または全部を渡して変換を行うことができます。よって、不正なバイトを意識せずにストリームから読み出した文字列を変換したいときには Encoding::Converter が適します。

なお、Encoding::Converter#convert では、これらの例外を捕獲しても、例外を起こしたと...

Encoding#replicate(name) -> Encoding (64.0)

レシーバのエンコーディングを複製(replicate)します。 複製されたエンコーディングは元のエンコーディングと同じバイト構造を持たなければなりません。 name という名前のエンコーディングが既に存在する場合は ArgumentError を発生します。

レシーバのエンコーディングを複製(replicate)します。
複製されたエンコーディングは元のエンコーディングと同じバイト構造を持たなければなりません。
name という名前のエンコーディングが既に存在する場合は ArgumentError を発生します。

Ruby 3.2 から非推奨となり、Ruby 3.3 で削除予定です。

//emlist[][ruby]{
encoding = Encoding::UTF_8.replicate("REPLICATED_UTF-8") #=> #<Encoding:REPLICATED_UTF-8>
encoding.name ...

絞り込み条件を変える

Enumerable#lazy -> Enumerator::Lazy (64.0)

自身を lazy な Enumerator に変換したものを返します。

自身を lazy な Enumerator に変換したものを返します。

この Enumerator は、以下のメソッドが遅延評価を行う (つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cycle (※一貫性のため、ブロックを渡さないケースのみl...

Enumerator::Lazy#collect_concat {|item| ... } -> Enumerator::Lazy (64.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。

* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ...

Enumerator::Lazy#flat_map {|item| ... } -> Enumerator::Lazy (64.0)

ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。

ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。

//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}

ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。

* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ...

String#valid_encoding? -> bool (64.0)

文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば true を返します。さもなくば false を返します。

文字列の内容が、現在のエンコーディングに照らしあわせて妥当であれば
true を返します。さもなくば false を返します。

//emlist[例][ruby]{
"\xc2\xa1".force_encoding("UTF-8").valid_encoding? #=> true
"\xc2".force_encoding("UTF-8").valid_encoding? #=> false
"\x80".force_encoding("UTF-8").valid_encoding? #=> false
//}

Encoding::Converter#insert_output(string) -> nil (46.0)

変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。

変換器内のバッファに文字列を挿入します。
バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。

変換先がステートフルなエンコーディングであった場合、
挿入された文字列は状態に基づいて変換され、状態を更新します。

このメソッドは変換に際してエラーが発生した際にのみ利用されるべきです。

@param string 挿入する文字列

//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec....

絞り込み条件を変える

String#encode(**options) -> String (46.0)

self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを...

String#encode(encoding, **options) -> String (46.0)

self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを...

String#encode(encoding, from_encoding, **options) -> String (46.0)

self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

self を指定したエンコーディングに変換した文字列を作成して返します。引数
を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな
くば self のエンコーディングが使われます。
無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。

@param encoding 変換先のエンコーディングを表す文字列か Encoding オブジェクトを...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (28.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

可搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (28.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

可搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (28.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

可搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (28.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

可搬性を確保しつつ、不正なバイトや変換先で未定義な文字の扱いを細かに指定したいときは、Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@...

Enumerator::Lazy#chunk {|elt| ... } -> Enumerator::Lazy (28.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...

Enumerator::Lazy#chunk(initial_state) {|elt, state| ... } -> Enumerator::Lazy (28.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...

Enumerator::Lazy#collect {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

絞り込み条件を変える

Enumerator::Lazy#drop(n) -> Enumerator::Lazy (28.0)

Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。

@param n 要素数を指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop(3)>

1.step.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 1...

Enumerator::Lazy#drop_while {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>

1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
//...

Enumerator::Lazy#find_all {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,...

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)....

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/).t...

絞り込み条件を変える

Enumerator::Lazy#map {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,...

Enumerator::Lazy#reject {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.reject { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:reject>

1.step.lazy.reject { |i| i.even? }.take(10).force
# => [1, 3, 5, 7, ...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,...

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (28.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [...

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (28.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [...

絞り込み条件を変える

Enumerator::Lazy#slice_before {|elt| bool } -> Enumerator::Lazy (28.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(initial_state) {|elt, state| bool } -> Enumerator::Lazy (28.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 (28.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_when {|elt_before, elt_after| bool } -> Enumerator::Lazy (28.0)

Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。

Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>

1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }.take(5).force
# => [[1, 2]...

Enumerator::Lazy#take(n) -> Enumerator::Lazy (28.0)

Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#take と同じですが、配列ではなくEnumerator::Lazy を返します。

n が大きな数 (100000とか) の場合に備えて再定義されています。
配列が必要な場合は Enumerable#first を使って下さい。

@param n 要素数を指定します。

@raise ArgumentError n に負の数を指定した場合に発生します。

//emlist[例][ruby]{
1.step.lazy.take(5)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:...

絞り込み条件を変える

Enumerator::Lazy#take_while -> Enumerator::Lazy (28.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy....

Enumerator::Lazy#take_while {|item| ... } -> Enumerator::Lazy (28.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy....

Enumerator::Lazy#zip(*lists) -> Enumerator::Lazy (28.0)

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle)...

Enumerator::Lazy#zip(*lists) {|v1, v2, ...| ... } -> nil (28.0)

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle)...

String#unicode_normalize(form = :nfc) -> String (28.0)

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。

self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し
た文字列を返します。

@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。

このメソッドでの "Unicode 文字列" とは、UTF-8、UTF-16BE/LE...

絞り込み条件を変える

String#unicode_normalized?(form = :nfc) -> bool (28.0)

self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。

self が引数 form で指定された正規化形式で Unicode 正規化された文字列か
どうかを返します。

@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。

@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。

//emlist[例][ruby]{
"a\u0300".unicode_normalized? ...