るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Range#size -> Integer | Float::INFINITY | nil (21244.0)

範囲内の要素数を返します。

...eError が発生します。

@
raise TypeError self がイテレート可能でない場合に発生します。

//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(1..).size # => Infinity
(-Float::INFINITY..Float::INFINITY).size # => can't iterate from Float (TypeError)...

Enumerator#size -> Integer | Float::INFINITY | nil (21238.0)

self の要素数を返します。

...ます。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。

//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFI...
...NITY
(1..100).drop_while.size # => nil
//}

@
see Enumerator.new...

Integer#size -> Integer (21232.0)

整数の実装上のサイズをバイト数で返します。

...整数の実装上のサイズをバイト数で返します。

//emlist[][ruby]{
p 1.size # => 8
p 0x1_0000_0000.size # => 8
//}

@
see Integer#bit_length...

File#size -> Integer (18238.0)

ファイルのサイズを返します。

...ファイルのサイズを返します。

//emlist[例][ruby]{
File.open("/dev/null") do |f|
f.size #=> 0
end
//}

@
raise IOError 自身が close されている場合に発生します。

@
raise Errno::EXXX 失敗した場合に発生します。

@
see File#lstat...

String#size -> Integer (18238.0)

文字列の文字数を返します。バイト数を知りたいときは bytesize メソッドを使ってください。

...いときは bytesize メソッドを使ってください。

//emlist[例][ruby]{
"test".length # => 4
"test".size # => 4
"テスト".length # => 3
"テスト".size # => 3
"\x80\u3042".length # => 2
"\x80\u3042".size # => 2
//}

@
see String#bytesize...

絞り込み条件を変える

CSV::Table#size -> Integer (15238.0)

(ヘッダを除く)行数を返します。

...(ヘッダを除く)行数を返します。

Array#length, Array#size に委譲しています。

//emlist[][ruby]{
r
equire 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.size # => 1
//}

@
see Array#length, Array#size...

String#rindex(pattern, pos = self.size) -> Integer | nil (9256.0)

文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。

...字列のインデックス pos から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のインデックスを返します。
見つからなければ nil を返します。

引数 pattern は探索する部分文字列または正規表現で指定...
...します。

pos が負の場合は、文字列の末尾から数えた位置から探索します。

r
index と String#index とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始位置を右から...
...

//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}

//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1)...

String#byterindex(pattern, offset = self.bytesize) -> Integer | nil (9255.0)

文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。

...ンデックス offset から左に向かって pattern を探索します。
最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。
見つからなければ nil を返します。

引数 pattern は探索する部分文字列または正規表現...
...で指定します。

offset が負の場合は、文字列の末尾から数えた位置から探索します。

byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索はその開始...
...emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}

//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("i...

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

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

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

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

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

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion...
...after output 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_b...

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

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

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

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

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

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion...
...after output 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_b...

絞り込み条件を変える

<< 1 2 3 ... > >>