Class: CsvBlueprints::PlanBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/csv_blueprints/plan_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(blueprint) ⇒ PlanBuilder

Returns a new instance of PlanBuilder.



3
4
5
6
# File 'lib/csv_blueprints/plan_builder.rb', line 3

def initialize(blueprint)
  @blueprint = blueprint
  @plan = Plan.new(@blueprint)
end

Instance Method Details

#customized(number, overrides) ⇒ Object



13
14
15
16
# File 'lib/csv_blueprints/plan_builder.rb', line 13

def customized(number, overrides)
  number.times { @plan.add_row(overrides) }
  self
end

#standard(number) ⇒ Object



8
9
10
11
# File 'lib/csv_blueprints/plan_builder.rb', line 8

def standard(number)
  number.times { @plan.add_row }
  self
end

#write(out = STDOUT) ⇒ Object



18
19
20
# File 'lib/csv_blueprints/plan_builder.rb', line 18

def write(out = STDOUT)
  PlanWriter.new(@plan).write(out)
end