Class: CSVPlusPlus::Writer::RubyXLBuilder
- Inherits:
-
Object
- Object
- CSVPlusPlus::Writer::RubyXLBuilder
- Extended by:
- T::Sig
- Includes:
- Merger
- Defined in:
- lib/csv_plus_plus/writer/rubyxl_builder.rb
Overview
Build a RubyXL workbook formatted according to the given rows
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- RubyXLCell =
::T.type_alias { ::T.all(::RubyXL::Cell, ::RubyXL::CellConvenienceMethods) }
- RubyXLValue =
::T.type_alias { ::T.any(::String, ::Numeric, ::Date) }
Instance Attribute Summary collapse
-
#output_filename ⇒ Pathname?
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::Workbook
with the given @rows insheet_name
. -
#initialize(options:, position:, rows:) ⇒ RubyXLBuilder
constructor
A new instance of RubyXLBuilder.
Methods included from Merger
Constructor Details
#initialize(options:, position:, rows:) ⇒ RubyXLBuilder
Returns a new instance of RubyXLBuilder.
34 35 36 37 38 39 40 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 34 def initialize(options:, position:, rows:) @options = @position = position @rows = rows @worksheet = ::T.let(open_worksheet, ::RubyXL::Worksheet) @reader = ::T.let(::CSVPlusPlus::Reader::RubyXL.new(@options, @worksheet), ::CSVPlusPlus::Reader::RubyXL) end |
Instance Attribute Details
#output_filename ⇒ Pathname? (readonly)
The filename being written to
11 12 13 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 11 def output_filename @output_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
46 47 48 49 |
# File 'lib/csv_plus_plus/writer/rubyxl_builder.rb', line 46 def build_workbook build_workbook! @worksheet.workbook end |