Class: Xlsxtream::Worksheet

Inherits:
Object
  • Object
show all
Defined in:
lib/xlsxtream/worksheet.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, sst = nil) ⇒ Worksheet

Returns a new instance of Worksheet.



7
8
9
10
11
12
# File 'lib/xlsxtream/worksheet.rb', line 7

def initialize(io, sst = nil)
  @io = io
  @rownum = 1
  @sst = sst
  write_header
end

Instance Method Details

#<<(row) ⇒ Object Also known as: add_row



14
15
16
17
# File 'lib/xlsxtream/worksheet.rb', line 14

def <<(row)
  @io << Row.new(row, @rownum, @sst).to_xml
  @rownum += 1
end

#closeObject



20
21
22
# File 'lib/xlsxtream/worksheet.rb', line 20

def close
  write_footer
end