るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

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

E
numerable#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 (20227.0)

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

...ング情報を指定された encoding に変えます。

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

@param encoding 変更するエン...
...す文字列か Encoding オブジェクトを指定します。

//emlist[例][ruby]{
s = [164, 164, 164, 237, 164, 207].pack("C*")
p s.encoding #=> ASCII-8BIT
p s.force_encoding("EUC-JP") #=> "いろは"
p s.force_encoding(Encoding::EUC_JP)...
...#=> "いろは"

u = [12411, 12408, 12392].pack("U*")
u.force_encoding("UTF-8") #=> "ほへと"
u.force_encoding(Encoding::UTF_8) #=> "ほへと"
//}...

Enumerator::Lazy#slice_when {|elt_before, elt_after| bool } -> Enumerator::Lazy (17108.0)

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

...
E
numerable#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], [3, 4, 5, 6, 7], [8, 9, 10, 11, 12], [13, 14, 15, 16, 17], [18, 19, 20, 21, 22]]
//}

@see Enumerable#slice_when...

Encoding::InvalidByteSequenceError (17014.0)

文字列がそのエンコーディングにおいて不正なバイト列である場合に発生 する例外。

...である場合に発生
する例外。

通常エンコーディング変換時に発生します。

//emlist[例][ruby]{
"\x82\xa0".force_encoding("cp932").encode("UTF-8")
#=> "あ"
"\x82\xa0".force_encoding("EUC-JP").encode("UTF-8")
#=> Encoding::InvalidByteSequenceError: "\x82" on EUC-JP
//}...

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

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

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

@param encoding 変換先のエンコーディングを表...
...す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return...

絞り込み条件を変える

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

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

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

@param encoding 変換先のエンコーディングを表...
...す文字列か Encoding オブジェクトを指定します。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return...

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

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

...Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes...
...ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true...
...op conversion after output before input
: integer form
E
ncoding::Converter::PARTIAL_INPUT
E
ncoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full...

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

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

...Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes...
...ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true...
...op conversion after output before input
: integer form
E
ncoding::Converter::PARTIAL_INPUT
E
ncoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full...

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

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

...Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes...
...ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true...
...op conversion after output before input
: integer form
E
ncoding::Converter::PARTIAL_INPUT
E
ncoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full...

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

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

...Encoding::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes...
...ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true...
...op conversion after output before input
: integer form
E
ncoding::Converter::PARTIAL_INPUT
E
ncoding::Converter::AFTER_OUTPUT

戻り値は以下のうちのどれかです。

* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full...

絞り込み条件を変える

<< 1 2 3 ... > >>