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
# File 'lib/simple_xlsx/document.rb', line 10

def add_sheet name, &block
  stream = @io.open_stream_for_sheet(@sheets.size)
  @sheets << Sheet.new(self, name, stream, &block)
end

#has_shared_strings?Boolean

Returns:

  • (Boolean)


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

def has_shared_strings?
  false
end