Class: SimpleXlsx::Document
- Inherits:
-
Object
- Object
- SimpleXlsx::Document
- Defined in:
- lib/simple_xlsx/document.rb
Instance Attribute Summary collapse
-
#sheets ⇒ Object
readonly
Returns the value of attribute sheets.
Instance Method Summary collapse
- #add_sheet(name, &block) ⇒ Object
- #has_shared_strings? ⇒ Boolean
-
#initialize(io) ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(io) ⇒ Document
Returns a new instance of Document.
3 4 5 6 |
# File 'lib/simple_xlsx/document.rb', line 3 def initialize(io) @sheets = [] @io = io end |
Instance Attribute Details
#sheets ⇒ Object (readonly)
Returns the value of attribute sheets.
8 9 10 |
# File 'lib/simple_xlsx/document.rb', line 8 def sheets @sheets end |
Instance Method Details
#add_sheet(name, &block) ⇒ Object
10 11 12 13 14 |
# File 'lib/simple_xlsx/document.rb', line 10 def add_sheet name, &block @io.open_stream_for_sheet(@sheets.size) do |stream| @sheets << Sheet.new(self, name, stream, &block) end end |
#has_shared_strings? ⇒ Boolean
16 17 18 |
# File 'lib/simple_xlsx/document.rb', line 16 def has_shared_strings? false end |