Class: Xlsxtream::Worksheet

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

Instance Method Summary collapse

Constructor Details

#initialize(io, options = {}) ⇒ Worksheet

Returns a new instance of Worksheet.



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

def initialize(io, options = {})
  @io = io
  @rownum = 1
  @options = options

  write_header
end

Instance Method Details

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



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

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

#closeObject



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

def close
  write_footer
end