Class: Sphyg::Enumerators::Cycle
- Defined in:
- lib/sphyg/enumerators/cycle.rb
Overview
Loops through each individual frame of the given sequence. Just like Enumerator#next but wraps around the array.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Sphyg::Enumerators::Base
Instance Method Details
#next ⇒ Object
8 9 10 11 |
# File 'lib/sphyg/enumerators/cycle.rb', line 8 def next @frames_index ||= 0 @frames[(@frames_index += 1) % @frames.length] end |