Module: Iterable
- Included in:
- Array
- Defined in:
- lib/cartesian_iterator.rb
Instance Method Summary collapse
Instance Method Details
#next ⇒ Object
93 94 95 96 |
# File 'lib/cartesian_iterator.rb', line 93 def next @next_index or restart raw_next end |
#raw_next ⇒ Object
98 99 100 |
# File 'lib/cartesian_iterator.rb', line 98 def raw_next self[@next_index += 1] end |
#restart ⇒ Object Also known as: start
87 88 89 90 |
# File 'lib/cartesian_iterator.rb', line 87 def restart @next_index = -1 true end |
#restart_and_raw_next ⇒ Object
102 103 104 |
# File 'lib/cartesian_iterator.rb', line 102 def restart_and_raw_next self[@next_index = 0] end |