Class: CsvBlueprints::PlanBuilder
- Inherits:
-
Object
- Object
- CsvBlueprints::PlanBuilder
- Defined in:
- lib/csv_blueprints/plan_builder.rb
Instance Method Summary collapse
- #customized(number, overrides) ⇒ Object
-
#initialize(blueprint) ⇒ PlanBuilder
constructor
A new instance of PlanBuilder.
- #standard(number) ⇒ Object
- #write(out = STDOUT) ⇒ Object
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 |