Class: RubyXL::Writer::SharedStringsWriter
- Inherits:
-
Object
- Object
- RubyXL::Writer::SharedStringsWriter
- Defined in:
- lib/rubyXL/writer/shared_strings_writer.rb
Instance Attribute Summary collapse
-
#dirpath ⇒ Object
Returns the value of attribute dirpath.
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#workbook ⇒ Object
Returns the value of attribute workbook.
Instance Method Summary collapse
-
#initialize(dirpath, wb) ⇒ SharedStringsWriter
constructor
A new instance of SharedStringsWriter.
- #write ⇒ Object
Constructor Details
#initialize(dirpath, wb) ⇒ SharedStringsWriter
Returns a new instance of SharedStringsWriter.
13 14 15 16 17 |
# File 'lib/rubyXL/writer/shared_strings_writer.rb', line 13 def initialize(dirpath,wb) @dirpath = dirpath @workbook = wb @filepath = dirpath + '/xl/sharedStrings.xml' end |
Instance Attribute Details
#dirpath ⇒ Object
Returns the value of attribute dirpath.
11 12 13 |
# File 'lib/rubyXL/writer/shared_strings_writer.rb', line 11 def dirpath @dirpath end |
#filepath ⇒ Object
Returns the value of attribute filepath.
11 12 13 |
# File 'lib/rubyXL/writer/shared_strings_writer.rb', line 11 def filepath @filepath end |
#workbook ⇒ Object
Returns the value of attribute workbook.
11 12 13 |
# File 'lib/rubyXL/writer/shared_strings_writer.rb', line 11 def workbook @workbook end |
Instance Method Details
#write ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/rubyXL/writer/shared_strings_writer.rb', line 19 def write() # Excel doesn't care much about the contents of sharedStrings.xml -- it will fill it in, but the file has to exist and have a root node. if @workbook.shared_strings_XML contents = @workbook.shared_strings_XML else contents = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+"\n"+'<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="0" uniqueCount="0"></sst>' end contents end |