Class: Workbook::Sheet

Inherits:
Array
  • Object
show all
Defined in:
lib/workbook/sheet.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Sheet) initialize(table = Workbook::Table.new([], self), book = nil, options = {})

Returns a new instance of Sheet



5
6
7
8
9
10
11
12
# File 'lib/workbook/sheet.rb', line 5

def initialize table=Workbook::Table.new([], self), book=nil, options={}
  if table.is_a? Workbook::Table
    push table
  else
    push Workbook::Table.new(table, self, options)
  end
  self.book = book
end

Instance Attribute Details

- (Object) book

Returns the value of attribute book



3
4
5
# File 'lib/workbook/sheet.rb', line 3

def book
  @book
end

Instance Method Details

- (Boolean) has_contents?

Returns:

  • (Boolean)


14
15
16
# File 'lib/workbook/sheet.rb', line 14

def has_contents?
  table.has_contents?
end

- (Object) table



18
19
20
# File 'lib/workbook/sheet.rb', line 18

def table
  first
end