種類
- インスタンスメソッド (223)
- 特異メソッド (165)
- 定数 (22)
ライブラリ
クラス
-
ARGF
. class (11) - CSV (11)
-
CSV
:: Row (22) - DateTime (66)
- Enumerator (22)
-
Enumerator
:: Lazy (10) - IO (121)
- MatchData (26)
- Pathname (22)
-
Psych
:: SyntaxError (11) - Regexp (22)
- Socket (11)
- StringIO (11)
-
WIN32OLE
_ METHOD (11)
モジュール
- Enumerable (22)
-
Socket
:: Constants (11)
キーワード
-
IPV6
_ CHECKSUM (22) - []= (11)
-
_ strptime (11) - binread (11)
- binwrite (22)
- byteoffset (4)
- civil (11)
- commercial (11)
-
copy
_ stream (22) - delete (11)
-
each
_ with _ index (22) - jd (11)
- match (22)
- new (11)
-
offset
_ vtbl (11) - ordinal (11)
- read (33)
- seek (44)
- sysseek (11)
-
with
_ index (32) - write (33)
検索結果
先頭5件
-
MatchData
# offset(name) -> [Integer , Integer] | [nil , nil] (21351.0) -
name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。
...nd] を返
します。
//emlist[例][ruby]{
[ self.begin(name), self.end(name) ]
//}
と同じです。nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。
@param name 名前(シンボルか文字列)
@raise IndexError 正規表現中で......//emlist[例][ruby]{
/(?<year>\d{4})年(?<month>\d{1,2})月(?:(?<day>\d{1,2})日)?/ =~ "2021年1月"
p $~.offset('year') # => [0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('centu......ry') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end......ry') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end, MatchData#offset... -
MatchData
# offset(n) -> [Integer , Integer] | [nil , nil] (21316.0) -
n 番目の部分文字列のオフセットの配列 [start, end] を返 します。
...emlist[例][ruby]{
[ self.begin(n), self.end(n) ]
//}
と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。
@param n 部分文字列を指定する数値
@raise IndexError 範囲外の n を指定した場合に発生します。
@see MatchDat......a#begin, MatchData#end......a#begin, MatchData#end, MatchData#offset... -
Psych
:: SyntaxError # offset -> Integer (21223.0) -
エラーが生じた位置の offset をバイト数で 返します。
...エラーが生じた位置の offset をバイト数で
返します。
offset とは、
Psych::SyntaxError#line, Psych::SyntaxError#column
で指示される位置からの相対位置です。
この位置から 0 バイトの位置でエラーが発生することが多いため、
このメ... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (18418.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with......_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ index(*args) -> Enumerator (18318.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with......_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerator
# with _ index(offset = 0) -> Enumerator (12336.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...ンデックスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[例][ruby]{
str = "xyz"
enum = Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [12......0, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]
# ["baz", 3]
//}
生成時のパラメータに従って、要素にインデックスを添えてブロックを繰......り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。... -
Enumerator
# with _ index(offset = 0) {|(*args) , idx| . . . } -> object (12336.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...ンデックスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[例][ruby]{
str = "xyz"
enum = Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [12......0, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]
# ["baz", 3]
//}
生成時のパラメータに従って、要素にインデックスを添えてブロックを繰......り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。... -
Enumerator
:: Lazy # with _ index(offset = 0) -> Enumerator :: Lazy (12318.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...クスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}
@see Enumerator#with_index... -
Enumerator
:: Lazy # with _ index(offset = 0) {|(*args) , idx| . . . } -> Enumerator :: Lazy (12318.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...クスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}
@see Enumerator#with_index... -
Socket
:: Constants :: IPV6 _ CHECKSUM -> Integer (12216.0) -
Byte offset into a packet where the checksum is located. BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
...Byte offset into a packet where the checksum is located.
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
ip6(4freebsd),
3542... -
Socket
:: IPV6 _ CHECKSUM -> Integer (12216.0) -
Byte offset into a packet where the checksum is located. BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。
...Byte offset into a packet where the checksum is located.
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。
@see Socket::Constants::IPPROTO_IPV6,
ip6(4freebsd),
3542...