316件ヒット
[201-300件を表示]
(0.083秒)
別のキーワード
クラス
-
CSV
:: Row (36) -
Encoding
:: Converter (36) - Enumerator (24)
-
Enumerator
:: Lazy (12) - IO (28)
- MatchData (30)
- Regexp (24)
- String (6)
- Struct (12)
- Time (84)
モジュール
- Enumerable (24)
キーワード
- [] (12)
- []= (24)
- advise (12)
- byteindex (3)
- byteoffset (6)
- byterindex (3)
- delete (12)
-
each
_ with _ index (24) - getlocal (24)
-
gmt
_ offset (12) - gmtoff (12)
- localtime (24)
- match (24)
- pread (8)
-
primitive
_ convert (36) - pwrite (8)
-
utc
_ offset (12) -
with
_ index (36)
検索結果
先頭5件
- Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol - Regexp
# match(str , pos = 0) -> MatchData | nil - Regexp
# match(str , pos = 0) {|m| . . . } -> object | nil - CSV
:: Row # []=(header _ or _ index , value) - CSV
:: Row # delete(header _ or _ index , minimum _ index = 0) -> [object , object] | nil
-
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (107.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ram source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定す......e
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished
//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p... -
Regexp
# match(str , pos = 0) -> MatchData | nil (55.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...t[例][ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.......実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emlist[例][ruby]{
results = []
/((.)\2)/.match("foo") {|m| results << m[0] } # => ["oo"]
/((.)\2)/.match("bar") {|m| results << m[0] } # => nil
results # => ["oo"......s 整数を指定します。マッチの開始位置を pos から行うよう制御できます(pos のデフォルト値は 0)。
//emlist[例][ruby]{
reg = Regexp.new("foo")
if reg.match("foobar")
puts "match"
end
# => match
p reg.match("foobar") # => #<MatchData:0x29403fc>
p reg.match("bar... -
Regexp
# match(str , pos = 0) {|m| . . . } -> object | nil (55.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...t[例][ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][ruby]{
re.......実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返します。
//emlist[例][ruby]{
results = []
/((.)\2)/.match("foo") {|m| results << m[0] } # => ["oo"]
/((.)\2)/.match("bar") {|m| results << m[0] } # => nil
results # => ["oo"......s 整数を指定します。マッチの開始位置を pos から行うよう制御できます(pos のデフォルト値は 0)。
//emlist[例][ruby]{
reg = Regexp.new("foo")
if reg.match("foobar")
puts "match"
end
# => match
p reg.match("foobar") # => #<MatchData:0x29403fc>
p reg.match("bar... -
CSV
:: Row # []=(header _ or _ index , value) (27.0) -
ヘッダの名前かインデックスでフィールドを探し、値をセットします。
...st[例 ヘッダの名前で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row["header1"] # => "row1_1"
row["header1"] = "updated"
row["header1"] # => "updated"
//}
//emlist[例 ヘッダの index で指定][ruby]{
require "csv"
row = CSV::Row.new......ow1_1", "row1_2"])
row["header1"] # => "row1_1"
row[0] = "updated"
row["header1"] # => "updated"
//}
//emlist[例 ヘッダの名前と offset で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], ["row1_1", "row1_2", "row1_3"])
row # => #<CSV::Row "header1":"r... -
CSV
:: Row # delete(header _ or _ index , minimum _ index = 0) -> [object , object] | nil (25.0) -
ヘッダの名前かインデックスで行からフィールドを削除するために使用します。
...の名前で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
row.delete("header1")
row # => #<CSV::Row "header2":"row1_2">
//}
//emlist[例 ヘッダの index で指定][ruby]{
require "csv"
r......V::Row "header1":"row1_1" "header2":"row1_2">
row.delete(0)
row # => #<CSV::Row "header2":"row1_2">
//}
//emlist[例 ヘッダの名前と offset で指定][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], ["row1_1", "row1_2", "row1_3"])
row # => #<CSV::Row "header1":"ro... -
Enumerable
# each _ with _ index(*args) -> Enumerator (19.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].eac......h_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) {|item , index| . . . } -> self (19.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].eac......h_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... -
Time
# getlocal -> Time (14.0) -
タイムゾーンを地方時に設定した Time オブジェクトを新しく生成 して返します。
...返します。
@param utc_offset タイムゾーンを地方時に設定する代わりに協定世界時との
時差を、秒を単位とする整数か、"+HH:MM" "-HH:MM" 形式
の文字列で指定します。
//emlist[][ruby]{
p t = Time.utc(2000,1,1,20,... -
Time
# localtime -> self (14.0) -
タイムゾーンを地方時に設定します。
...を地方時に設定します。
このメソッドを呼び出した後は時刻変換を協定地方時として行ないます。
@param utc_offset タイムゾーンを地方時に設定する代わりに協定世界時との
時差を、秒を単位とする整数か、"+HH......合があります。システムを越えて Time オブジェクトを受け
渡す場合には注意する必要があります。
//emlist[][ruby]{
p t = Time.utc(2000, "jan", 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
p t.utc? # => true
p t.localtime...