722件ヒット
[1-100件を表示]
(0.128秒)
ライブラリ
クラス
- Array (57)
- CSV (12)
-
CSV
:: Table (24) -
Encoding
:: Converter (24) - Enumerator (12)
- File (24)
- Integer (24)
- Matrix (24)
- Method (24)
-
Net
:: HTTPGenericRequest (24) - Object (48)
- Random (12)
- Range (24)
- String (223)
- StringScanner (48)
- Struct (12)
-
Thread
:: SizedQueue (58) - UnboundMethod (24)
モジュール
-
Fiddle
:: Importer (12) -
Rake
:: TaskManager (12)
キーワード
- == (24)
- [] (84)
- bind (12)
-
bit
_ length (12) -
body
_ stream (12) -
body
_ stream= (12) - bsearch (48)
- byterindex (3)
- bytes (12)
- bytesize (12)
- clear (12)
- close (10)
- deq (12)
-
each
_ grapheme _ cluster (16) -
each
_ index (12) -
enum
_ for (24) - eql? (24)
-
field
_ size _ limit (12) - length (24)
- max= (12)
- minor (24)
- pack (21)
- peek (12)
- peep (12)
- pop (12)
-
primitive
_ convert (24) - rindex (12)
- shift (12)
- slice (72)
-
synthesize
_ file _ task (12) - terminate (12)
-
to
_ enum (24) - truncate (12)
- unpack (12)
検索結果
先頭5件
-
Enumerator
# size -> Integer | Float :: INFINITY | nil (21232.0) -
self の要素数を返します。
...は Float::INFINITY を返します。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。
//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 941094......00
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}
@see Enumerator.new... -
Integer
# size -> Integer (21226.0) -
整数の実装上のサイズをバイト数で返します。
...整数の実装上のサイズをバイト数で返します。
//emlist[][ruby]{
p 1.size # => 8
p 0x1_0000_0000.size # => 8
//}
@see Integer#bit_length... -
CSV
:: Table # size -> Integer (18232.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... -
File
# size -> Integer (18232.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 (18232.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... -
Rake
:: TaskManager # synthesize _ file _ task(task _ name) -> Rake :: FileTask | nil (15225.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
IO.write("sample_file", "")
task.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_fil... -
String
# bytesize -> Integer (12325.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
CSV
# field _ size _ limit -> Integer (12238.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... -
StringScanner
# terminate -> self (9219.0) -
スキャンポインタを文字列末尾後まで進め、マッチ記録を捨てます。
...てます。
@return self を返します。
pos = self.string.size と同じ動作です。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan(/\w+/) # => "test"
s.matched # => "test"
s.pos # => 4
s[0] # => "test"
s.terminate
s.matched #......=> nil
s[0] # => nil
s.pos # => 11
//}
StringScanner#clear は将来のバージョンで削除される予定です。
代わりに StringScanner#terminate を使ってください。...