Class: SimpleXlsx::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_xlsx/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sheetsObject (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

Returns:

  • (Boolean)


16
17
18
# File 'lib/simple_xlsx/document.rb', line 16

def has_shared_strings?
  false
end