るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

検索結果

StringScanner#string=(str) (36444.0)

スキャン対象の文字列を str に変更して、マッチ記録を捨てます。

...str に変更して、マッチ記録を捨てます。

@
param str スキャン対象の文字列を str に変更して、マッチ記録を捨てます。

@
return str を返します。

//emlist[例][ruby]{
require 'strscan'

str = '0123'
s = StringScanner.new('test string')
s.string = str...

Enumerator#with_object(obj) -> Enumerator (6155.0)

繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。

...返す Enumerator を返します。

//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
t
o_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end

t
o_three_with_string = to_three.with_object("foo")
t
o_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# =>...
...foo:0
# => foo:1
# => foo:2
//}

@
param obj 繰り返しの各要素に添えて渡されるオブジェクト
@
see Enumerable#each_with_object...

Enumerator#with_object(obj) {|(*args), memo_obj| ... } -> object (6155.0)

繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。

...返す Enumerator を返します。

//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
t
o_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end

t
o_three_with_string = to_three.with_object("foo")
t
o_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# =>...
...foo:0
# => foo:1
# => foo:2
//}

@
param obj 繰り返しの各要素に添えて渡されるオブジェクト
@
see Enumerable#each_with_object...