446件ヒット
[1-100件を表示]
(0.260秒)
検索結果
先頭5件
-
ARGF
. class # pos -> Integer (26127.0) -
ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位 の整数で返します。
...ARGFが現在開いているファイルのファイルポインタの現在の位置をバイト単位
の整数で返します。
ARGF.pos # => 0
ARGF.gets # => "This is line one\n"
ARGF.pos # => 17
@see IO#pos, IO#tell, ARGF.class#pos=... -
IO
# pos -> Integer (26115.0) -
ファイルポインタの現在の位置を整数で返します。
...タの現在の位置を整数で返します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\n")
File.open("testfile") do |f|
f.pos # => 0
f.gets # => "This is line one\n"
f.pos # => 17
end
//}... -
Dir
# pos -> Integer (26109.0) -
ディレクトリストリームの現在の位置を整数で返します。
...ディレクトリストリームの現在の位置を整数で返します。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open("/tmp") {|d|
d.each {|f|
p d.pos
}
}
//}... -
Dir
# pos=(pos) (14243.0) -
ディレクトリストリームの読み込み位置を pos に移動させます。 pos は Dir#tell で与えられた値でなければなりま せん。
...ディレクトリストリームの読み込み位置を pos に移動させます。
pos は Dir#tell で与えられた値でなければなりま
せん。
@param pos 変更したい位置を整数で与えます。
@raise IOError 既に自身が close している場合に発生します。... -
ARGF
. class # pos=(n) (14121.0) -
ARGFが開いているファイルのファイルポインタを指定位置に移動します。
...ARGFが開いているファイルのファイルポインタを指定位置に移動します。
@param n 先頭からのオフセットをバイト単位の整数で指定します。
ARGF.pos = 17
ARGF.gets # => "This is line two\n"
@see IO#pos=, ARGF.class#pos... -
IO
# pos=(n) (14115.0) -
ファイルポインタを指定位置に移動します。 IO#seek(n, IO::SEEK_SET) と同じです。
...ットを整数で指定します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
f.pos # => 0
f.pos = 17
f.gets # => "This is line two\n"
end
//}... -
Array
# transpose -> Array (14102.0) -
自身を行列と見立てて、行列の転置(行と列の入れ換え)を行いま す。転置した配列を生成して返します。空の配列に対しては空の配列を生 成して返します。
...p [[1,2],
[3,4],
[5,6]].transpose
# => [[1, 3, 5], [2, 4, 6]]
p [].transpose
# => []
p [1,2,3].transpose
# => -:1:in `transpose': cannot convert Fixnum into Array (TypeError)
# from -:1
p [[1,2],
[3,4,5],
[6,7]].transpose
# => -:3:in `transpose': element size differ (3 should b... -
Float
# positive? -> bool (14102.0) -
self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
...self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
0.1.positive? # => true
0.0.positive? # => false
-0.1.positive? # => false
//}
@see Float#negative?... -
MatchData
# post _ match -> String (14102.0) -
マッチした部分より後ろの文字列を返します($'と同じ)。
...マッチした部分より後ろの文字列を返します($'と同じ)。
//emlist[例][ruby]{
/(bar)(BAZ)?/ =~ "foobarbaz"
p $~.post_match # => "baz"
//}
@see MatchData#pre_match... -
Numeric
# positive? -> bool (14102.0) -
self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
...self が 0 より大きい場合に true を返します。そうでない場合に false を返します。
//emlist[例][ruby]{
1.positive? # => true
0.positive? # => false
-1.positive? # => false
//}
@see Numeric#negative?...