Class: Xlsxtream::Worksheet
- Inherits:
-
Object
- Object
- Xlsxtream::Worksheet
- Defined in:
- lib/xlsxtream/worksheet.rb
Instance Method Summary collapse
- #<<(row) ⇒ Object (also: #add_row)
- #close ⇒ Object
- #closed? ⇒ Boolean
- #id ⇒ Object
-
#initialize(io, options = {}) ⇒ Worksheet
constructor
A new instance of Worksheet.
- #name ⇒ Object
Constructor Details
#initialize(io, options = {}) ⇒ Worksheet
Returns a new instance of Worksheet.
7 8 9 10 11 12 13 14 |
# File 'lib/xlsxtream/worksheet.rb', line 7 def initialize(io, = {}) @io = io @rownum = 1 @closed = false @options = write_header end |
Instance Method Details
#<<(row) ⇒ Object Also known as: add_row
16 17 18 19 |
# File 'lib/xlsxtream/worksheet.rb', line 16 def <<(row) @io << Row.new(row, @rownum, @options).to_xml @rownum += 1 end |
#close ⇒ Object
22 23 24 25 |
# File 'lib/xlsxtream/worksheet.rb', line 22 def close @closed = true end |
#closed? ⇒ Boolean
27 28 29 |
# File 'lib/xlsxtream/worksheet.rb', line 27 def closed? @closed end |
#id ⇒ Object
31 32 33 |
# File 'lib/xlsxtream/worksheet.rb', line 31 def id @options[:id] end |
#name ⇒ Object
35 36 37 |
# File 'lib/xlsxtream/worksheet.rb', line 35 def name @options[:name] end |