class CsvBlueprints::Plan

Public Class Methods

new(blueprint) click to toggle source
# File lib/csv_blueprints/plan.rb, line 27
def initialize(blueprint)
  @blueprint = blueprint
  @rows = []
end

Public Instance Methods

add_row(overrides = {}) click to toggle source
# File lib/csv_blueprints/plan.rb, line 32
def add_row(overrides = {})
  if overrides.any?
    @rows << CustomizedRow.new(overrides)
  else
    @rows << StandardRow.new
  end
end
column_names() click to toggle source
# File lib/csv_blueprints/plan.rb, line 40
def column_names
  @blueprint.column_names
end
each_row() { |values_for(index + 1, blueprint)| ... } click to toggle source
# File lib/csv_blueprints/plan.rb, line 44
def each_row
  @rows.each.with_index do |row, index|
    yield row.values_for(index + 1, @blueprint)
  end
end