class CsvBlueprints::PlanWriter

Public Class Methods

new(plan) click to toggle source
# File lib/csv_blueprints/plan_writer.rb, line 5
def initialize(plan)
  @plan = plan
end

Public Instance Methods

write(out) click to toggle source
# File lib/csv_blueprints/plan_writer.rb, line 9
def write(out)
  csv = CSV.new(out, headers: @plan.column_names, write_headers: true)

  @plan.each_row { |row| csv << row }

  csv
end