def intersperse(enum, opts={})
      sep = opts[:sep]
      newlines = opts[:newlines] || (opts[:newline] ? 1 : 0)
      enum.each_with_index do |_, i|
        if i > 0
          self << sep if sep
          newlines.times { newline }
        end
        yield _
      end
      self
    end
def intersperse(enum, opts={})
      sep = opts[:sep]
      newlines = opts[:newlines] || (opts[:newline] ? 1 : 0)
      enum.each_with_index do |_, i|
        if i > 0
          self << sep if sep
          newlines.times { newline }
        end
        yield _
      end
      self
    end
Add a separator or newlines or both in between code generated in the
 given block for each element in +enum+. Newlines, are always added
 after the separator.

 @param [Enumerable] enum an enumerable sequence of objects

 @option opts [String] :sep (nil) optional separator to use between
   elements
 @option opts [true, false] :newline (false) separate with a single
   newline if +true+ (and if :newlines is not specified)
 @option opts [Integer] :newlines (nil) optional number of newlines to
   use between elements (overrides :newline)

 @yield [element] each element in +enum+

 @return [self]