Class: Cosmos::ExcelSpreadsheet::ExcelWorksheet

Inherits:
Object
  • Object
show all
Defined in:
lib/cosmos/win32/excel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(worksheet) ⇒ ExcelWorksheet

Returns a new instance of ExcelWorksheet.



26
27
28
29
30
31
32
33
# File 'lib/cosmos/win32/excel.rb', line 26

def initialize (worksheet)
  @name = worksheet.name
  @num_rows = worksheet.UsedRange.rows.count
  @num_columns = worksheet.UsedRange.columns.count

  #Get Excel Data from Worksheet
  @data = worksheet.UsedRange.value
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



24
25
26
# File 'lib/cosmos/win32/excel.rb', line 24

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



24
25
26
# File 'lib/cosmos/win32/excel.rb', line 24

def name
  @name
end

#num_columnsObject (readonly)

Returns the value of attribute num_columns.



24
25
26
# File 'lib/cosmos/win32/excel.rb', line 24

def num_columns
  @num_columns
end

#num_rowsObject (readonly)

Returns the value of attribute num_rows.



24
25
26
# File 'lib/cosmos/win32/excel.rb', line 24

def num_rows
  @num_rows
end