class DumbDownViewer::TreeViewBuilder::TreeCSVFormat

Public Class Methods

new(line_pattern=:default, col_sep=',', node_format=nil) click to toggle source
# File lib/dumb_down_viewer/tree_view_builder.rb, line 111
def initialize(line_pattern=:default, col_sep=',', node_format=nil)
  @line = LINE_PATTERNS[line_pattern]
  @col_sep = col_sep
  @node_format = node_format || NodeFormat.new
end

Public Instance Methods

table_to_output_format(table) click to toggle source
# File lib/dumb_down_viewer/tree_view_builder.rb, line 117
def table_to_output_format(table)
  CSV.generate('', col_sep: @col_sep) do |csv|
    table.each {|row| csv << row }
  end
end