Module: CoreEx::ArrayIterator
- Defined in:
- lib/core_ex/array.rb
Instance Method Summary collapse
Instance Method Details
#next ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/core_ex/array.rb', line 3 def next unless self.size.zero? res = (@current ||= 0) if self.size == (@current += 1) @current = 0 end self[res] end end |