Method: When::Parts::Enumerator#with_index
- Defined in:
- lib/when_exe/parts/enumerator.rb
#with_index(offset = 0, &block) ⇒ When::Parts:Enumerator
index をブロックに渡して評価する
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/when_exe/parts/enumerator.rb', line 126 def with_index(offset=0, &block) if block_given? @index = offset||@count return each(block) else copy = _copy copy.object = nil copy.index = offset||@count return copy end end |