るりまサーチ

最速Rubyリファレンスマニュアル検索!
458件ヒット [1-100件を表示] (0.119秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

MatchData#end(n) -> Integer | nil (18256.0)

n 番目の部分文字列終端のオフセットを返します。

...param n 部分文字列を指定する数値。

@raise IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end(4) # => `end': index 4...
...out of matches (IndexError)
//}

@see MatchData#begin...

CSV::FieldInfo#index -> Integer (18226.0)

行内で何番目のフィールドかわかるゼロベースのインデックスを返します。

...デックスを返します。

//emlist[例][ruby]{
r
equire 'csv'

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end

p csv.first

# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n...

Prime::PseudoPrimeGenerator#each_with_index {|prime, index| ... } -> self (12349.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...す。

@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]...
...# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Prime::PseudoPrimeGenerator#with_index {|prime, index| ... } -> self (12349.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...す。

@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]...
...# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Net::HTTP#send_request(name, path, data = nil, header = nil) -> Net::HTTPResponse (12319.0)

HTTP リクエストをサーバに送り、そのレスポンスを Net::HTTPResponse のインスタンスとして返します。

...Net::HTTPResponse のインスタンスとして返します。

@param name リクエストのメソッド名を文字列で与えます。
@param path リクエストのパスを文字列で与えます。
@param data リクエストのボディを文字列で与えます。
@param header リク...
...エストのヘッダをハッシュで与えます。

//emlist[例][ruby]{
r
esponse = http.send_request('GET', '/index.html')
puts response.body
//}

@see Net::HTTP#request...

絞り込み条件を変える

Prime::PseudoPrimeGenerator#each_with_index -> Enumerator (12249.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...す。

@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]...
...# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Prime::PseudoPrimeGenerator#with_index -> Enumerator (12249.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...す。

@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
r
equire 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]...
...# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Enumerable#each_with_index(*args) {|item, index| ... } -> self (9370.0)

要素とそのインデックスをブロックに渡して繰り返します。

...デックスを繰り返すような
Enumerator を返します。

Enumerator#with_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]{
r
equire '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 (9270.0)

要素とそのインデックスをブロックに渡して繰り返します。

...デックスを繰り返すような
Enumerator を返します。

Enumerator#with_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]{
r
equire '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...
<< 1 2 3 ... > >>