103件ヒット
[101-103件を表示]
(0.208秒)
種類
- インスタンスメソッド (57)
- 特異メソッド (30)
- モジュール関数 (15)
- クラス (1)
クラス
- BasicObject (4)
- Class (2)
- Enumerator (11)
-
Enumerator
:: Chain (2) -
Enumerator
:: Lazy (7) - Hash (1)
- IO (17)
- Method (6)
- Module (3)
- NoMethodError (3)
- Object (10)
- Proc (1)
-
RubyVM
:: InstructionSequence (1) - String (1)
- Struct (4)
- UnboundMethod (2)
モジュール
- Enumerable (8)
- Kernel (15)
- Process (1)
-
RubyVM
:: AbstractSyntaxTree (3)
キーワード
- % (1)
- === (1)
- BasicObject (1)
- [] (2)
-
_ _ send _ _ (2) - allocate (1)
-
bind
_ call (2) - call (2)
- caller (3)
-
class
_ exec (1) - curry (2)
- each (6)
-
each
_ with _ index (2) -
each
_ with _ object (2) - entries (1)
-
enum
_ for (4) - exec (5)
- force (1)
- initialize (1)
-
instance
_ exec (1) -
method
_ missing (1) -
module
_ exec (1) - new (8)
-
next
_ values (1) - of (1)
- parse (1)
-
parse
_ file (1) - popen (14)
-
public
_ send (2) - read (3)
-
respond
_ to _ missing? (1) -
ruby2
_ keywords (2) -
ruby2
_ keywords _ hash? (1) - send (2)
- spawn (4)
- system (4)
-
to
_ a (2) -
to
_ enum (4) -
to
_ h (2) -
with
_ index (4) -
with
_ object (2)
検索結果
先頭3件
-
Enumerator
# with _ index(offset = 0) -> Enumerator (24010.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] }
# => [120, 0]
# [121, 1]
# [122, 2]
require "stringi... -
Enumerator
# with _ object(obj) -> Enumerator (24010.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
obj には任意のオブジェクトを渡すことができます。
ブロックが渡されなかった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object... -
Enumerator
:: Lazy # with _ index(offset = 0) -> Enumerator :: Lazy (24010.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