るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...il を返し、始端が succ メソッドを持たない場合は TypeError が発生します。

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

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

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

self の要素数を返します。

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

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

@
see Enumerator.new...

File#size -> Integer (24238.0)

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

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

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

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

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

@
see File#lstat...

Integer#size -> Integer (24232.0)

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

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

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

@
see Integer#bit_length...

String#size -> Integer (21238.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 (18238.0)

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

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

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

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

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

CSV#field_size_limit -> Integer (12244.0)

フィールドサイズの最大値を返します。

...

//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA)
csv.field_size_limit # => nil
p csv.read # => [["a", "b"], ["\n2\n2\n", ""]]

DATA.rewind
csv = CSV.new(DATA, field_size_limit: 4)
p csv.field_size_limit # => 4
csv.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>

__END...
...__
"a","b"
"
2
2
",""
//}

@
see CSV.new...

Rake::TaskManager#synthesize_file_task(task_name) -> Rake::FileTask | nil (12231.0)

与えられたタスク名をもとにファイルタスクを合成します。

...合成します。

@
param task_name タスク名を指定します。

@
return 与えられたタスク名と同名のファイルが存在する場合は、ファイルタスクを作成して返します。
そうでない場合は nil を返します。

@
raise RuntimeError タスクを...
...//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app

task :test_rake_app do |task|
task.application.synthesize_file_task("sample_file") # => nil
I
O.write("sample_file", "")
task.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_file =>...

String#bytesize -> Integer (12231.0)

文字列のバイト長を整数で返します。

...文字列のバイト長を整数で返します。

//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}

@
see String#size...

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

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

...します。
見つからなければ nil を返します。

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

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

rindex と String#index とでは、探索方向だけが...
...

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

//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1)...
...# ing # インデックス -1 の文字から探索を始める
# ing
# ing # 左にずらしていってここで見つかる
//}

@
param pattern 探索する部分文字列または正規表現
@
param pos 探索を始めるインデックス

//emlis...

絞り込み条件を変える

<< 1 2 3 ... > >>