cycle.md
November 21, 2015 ยท View on GitHub
Cycle
ring = %w[one two three].cycle
p ring.take(5)
# Result:
# ["one", "two", "three", "one", "two"]
November 21, 2015 ยท View on GitHub
ring = %w[one two three].cycle
p ring.take(5)
# Result:
# ["one", "two", "three", "one", "two"]