356件ヒット
[1-100件を表示]
(0.106秒)
別のキーワード
ライブラリ
- ビルトイン (260)
-
fiddle
/ import (12) - matrix (24)
- rake (12)
-
rexml
/ document (24) - strscan (24)
クラス
- Array (45)
-
Encoding
:: Converter (24) - Enumerator (12)
- File (12)
-
File
:: Stat (36) - MatchData (24)
- Matrix (24)
- Object (48)
-
REXML
:: Attributes (24) -
Rake
:: Application (12) - Range (24)
- String (35)
- StringScanner (24)
モジュール
-
Fiddle
:: Importer (12)
キーワード
- bind (12)
- blksize (12)
- bsearch (24)
- byterindex (3)
-
each
_ grapheme _ cluster (8) -
each
_ index (12) -
enum
_ for (24) - length (24)
-
matched
_ size (12) - minor (24)
- pack (21)
-
primitive
_ convert (24) - rindex (12)
- size? (12)
- terminate (12)
-
to
_ enum (24) - truncate (12)
- unpack (12)
検索結果
先頭5件
-
Enumerator
# size -> Integer | Float :: INFINITY | nil (24332.0) -
self の要素数を返します。
...合は Float::INFINITY を返します。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。
//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 941......09400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}
@see Enumerator.new... -
Range
# size -> Integer | Float :: INFINITY | nil (21338.0) -
範囲内の要素数を返します。
...を返します。始端、終端のいずれかのオブジェクトが
Numeric のサブクラスのオブジェクトではない場合には nil を返します。
//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(-Float::INFINITY..Float::INFINITY).size # => Infinity
//}......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)... -
MatchData
# size -> Integer (21236.0) -
部分文字列の数を返します(self.to_a.size と同じです)。
...部分文字列の数を返します(self.to_a.size と同じです)。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.size # => 4
//}... -
File
:: Stat # size -> Integer (21220.0) -
ファイルサイズ(バイト単位)を返します。
...ファイルサイズ(バイト単位)を返します。
//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.size #=> 1548
//}... -
REXML
:: Attributes # size -> Integer (21214.0) -
属性の個数を返します。
...ます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
p a.attributes.length # => 3
//}... -
StringScanner
# matched _ size -> Integer | nil (15350.0) -
前回マッチした部分文字列の長さを返します。 前回マッチに失敗していたら nil を返します。
...ruby]{
require 'strscan'
def run(encode)
utf8 = "\u{308B 3073 3044}" # るびい
s = StringScanner.new(utf8.encode(encode))
s.scan(/#{"\u{308B}".encode(encode)}/)
s.matched_size
end
p run("UTF-8") #=> 3
p run("EUC-JP") #=> 2
p run("Shift_Jis") #=> 2
//}
//emlist[例][ruby]{
requir......e 'strscan'
s = StringScanner.new('test string')
s.matched_size # => nil
s.scan(/\w+/) # => "test"
s.matched_size # => 4
s.scan(/\w+/) # => nil
s.matched_size # => nil
//}... -
File
# truncate(length) -> 0 (12219.0) -
ファイルのサイズを最大 length バイトにします。
...失敗した場合は例外
Errno::EXXX が発生します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX サイズの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
Fi......le.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5
end
//}... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9513.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t 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_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9513.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...:Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t 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_buffer_empty...