class MTK::Patterns::Cycle
An endless enumerator that outputs an element one at a time from a list of elements, looping back to the beginning when elements run out. This is the same as a Sequence
but by default has unlimited @max_cycles
Public Class Methods
new(elements, options={})
click to toggle source
Calls superclass method
# File lib/mtk/patterns/cycle.rb, line 9 def initialize(elements, options={}) super # Base Pattern & Sequence default to 1 max_cycle, this defaults to nil which is unlimited cycles @max_cycles = options[:max_cycles] end