Module: Iterable
- Included in:
- Array
- Defined in:
- lib/cartesian_iterator.rb
Instance Method Summary collapse
- #next ⇒ Object
- #raw_next ⇒ Object
- #restart_and_raw_next ⇒ Object
- #start ⇒ Object (also: #restart)
Instance Method Details
#next ⇒ Object
60 61 62 63 |
# File 'lib/cartesian_iterator.rb', line 60 def next @next_index or restart raw_next end |
#raw_next ⇒ Object
65 66 67 |
# File 'lib/cartesian_iterator.rb', line 65 def raw_next self[@next_index += 1] end |
#restart_and_raw_next ⇒ Object
69 70 71 |
# File 'lib/cartesian_iterator.rb', line 69 def restart_and_raw_next self[@next_index = 0] end |
#start ⇒ Object Also known as: restart
54 55 56 57 |
# File 'lib/cartesian_iterator.rb', line 54 def start @next_index = -1 true end |