Class: SpreadsheetML

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

Defined Under Namespace

Classes: Cell, Row, Table, Worksheet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream_or_string) ⇒ SpreadsheetML

Returns a new instance of SpreadsheetML.



6
7
8
9
10
11
12
13
14
# File 'lib/spreadsheetml.rb', line 6

def initialize(stream_or_string)
  @worksheets = []

  return if stream_or_string.nil?

  doc = REXML::Document.new stream_or_string

  doc.elements.each("Workbook/Worksheet") { |worksheet| @worksheets << Worksheet.new(worksheet) }
end

Instance Attribute Details

#worksheetsObject

Returns the value of attribute worksheets.



4
5
6
# File 'lib/spreadsheetml.rb', line 4

def worksheets
  @worksheets
end