lib/tabulo/table.rb
def each
      @sources.each_with_index do |source, index|
        header =
          if (index == 0) && @header_frequency
            :top
          elsif (Integer === @header_frequency) && Util.divides?(@header_frequency, index)
            :middle
          end

        show_divider = @row_divider_frequency && (index != 0) && Util.divides?(@row_divider_frequency, index)

        yield Row.new(self, source, header: header, divider: show_divider, index: index)
      end
    end
# Calls the given block once for each {Row} in the Table, passing that {Row} as parameter.
#
# @example
#   table.each do |row|
#     puts row
#   end
#
# Note that when printed, the first row will visually include the headers (assuming these
# were not disabled when the Table was initialized).
Calls the given block once for each {Row} in the Table, passing that {Row} as parameter.
Calls the given block once for each { Row } in the Table passing that { Row } as parameter .
def each
      @sources.each_with_index do |source, index|
        header =
          if (index == 0) && @header_frequency
            :top
          elsif (Integer === @header_frequency) && Util.divides?(@header_frequency, index)
            :middle
          end
        show_divider = @row_divider_frequency && (index != 0) && Util.divides?(@row_divider_frequency, index)
        yield Row.new(self, source, header: header, divider: show_divider, index: index)
      end
    end
def each @sources . each_with_index do | source , index | header = if ( index == 0 ) && @header_frequency :top elsif ( Integer === @header_frequency ) && Util . divides? ( @header_frequency , index ) :middle end show_divider = @row_divider_frequency && ( index != 0 ) && Util . divides? ( @row_divider_frequency , index ) yield Row . new ( self , source , header : header , divider : show_divider , index : index ) end end
Calls the given block once for each {Row} in the Table, passing that {Row} as parameter.
Calls the given block once for each { Row } in the Table passing that { Row } as parameter .
example
table.each do |row| puts row end Note that when printed, the first row will visually include the headers (assuming these were not disabled when the Table was initialized).
table . each do |row| puts row end Note that when printed the first row will visually include the headers ( assuming these were not disabled when the Table was initialized ) .