Module: Iterable
- Included in:
- Array
- Defined in:
- lib/cartesian_iterator.rb
Instance Method Summary collapse
Instance Method Details
#next ⇒ Object
83 84 85 86 |
# File 'lib/cartesian_iterator.rb', line 83 def next restart unless defined? @next_index raw_next end |
#raw_next ⇒ Object
88 89 90 |
# File 'lib/cartesian_iterator.rb', line 88 def raw_next self[@next_index += 1] end |
#restart ⇒ Object
78 79 80 81 |
# File 'lib/cartesian_iterator.rb', line 78 def restart @next_index = -1 true end |
#restart_and_raw_next ⇒ Object
92 93 94 |
# File 'lib/cartesian_iterator.rb', line 92 def restart_and_raw_next self[@next_index = 0] end |