Class: CSVPlusPlus::Writer::RubyXLBuilder
- Inherits:
-
Object
- Object
- CSVPlusPlus::Writer::RubyXLBuilder
- Defined in:
- lib/csv_plus_plus/writer/rubyxl_builder.rb
Overview
Build a RubyXL workbook formatted according to the given rows
Instance Attribute Summary collapse
-
#input_filename ⇒ String
readonly
The filename being written to.
-
#rows ⇒ Array<Row>
readonly
The rows being written.
Instance Method Summary collapse
-
#build_workbook ⇒ RubyXL::Workbook
Build a
RubyXL::Workbookwith the given @rows insheet_name. -
#initialize(input_filename:, rows:, sheet_name:) ⇒ RubyXLBuilder
constructor
A new instance of RubyXLBuilder.
Constructor Details
#initialize(input_filename:, rows:, sheet_name:) ⇒ RubyXLBuilder
Returns a new instance of RubyXLBuilder.
17 18 19 20 21 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 17 def initialize(input_filename:, rows:, sheet_name:) @rows = rows @input_filename = input_filename @sheet_name = sheet_name end |
Instance Attribute Details
#input_filename ⇒ String (readonly)
The filename being written to
11 12 13 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 11 def input_filename @input_filename end |
#rows ⇒ Array<Row> (readonly)
The rows being written
11 12 13 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 11 def rows @rows end |
Instance Method Details
#build_workbook ⇒ RubyXL::Workbook
Build a RubyXL::Workbook with the given @rows in sheet_name
26 27 28 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 26 def build_workbook open_workbook.tap { build_workbook! } end |