Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/array_transitions.rb
Instance Method Summary collapse
Instance Method Details
#transitions ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/array_transitions.rb', line 5 def transitions map.with_index do |e, i| next if size == i + 1 next_element = self[i + 1] next if next_element == e { from: e, to: next_element } end.compact end |