module ArraySlices
Public Instance Methods
slice_at(*indices)
click to toggle source
# File lib/qnd_html2page.rb, line 15 def slice_at(*indices) a = indices a << -1 if a[-1] != self[-1] a.unshift -1 a.each_cons(2).map {|x1, x2| self.slice(x1+1..x2) } end