class Array
Public Instance Methods
neighbours()
click to toggle source
# File lib/name_tamer/array.rb, line 3 def neighbours last_index = length - 1 0.upto(last_index).flat_map { |i| i.upto(last_index).map { |j| self[i..j] } } end