Class: Workbook::Worksheets

Inherits:
Array
  • Object
show all
Defined in:
lib/writeexcel/worksheets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorksheets

Returns a new instance of Worksheets.



7
8
9
10
# File 'lib/writeexcel/worksheets.rb', line 7

def initialize
  @activesheet = nil
  @firstsheet  = nil
end

Instance Attribute Details

#activesheetObject

Returns the value of attribute activesheet.



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

def activesheet
  @activesheet
end

#firstsheet=(value) ⇒ Object (writeonly)

Sets the attribute firstsheet

Parameters:

  • value

    the value to set the attribute firstsheet to.



5
6
7
# File 'lib/writeexcel/worksheets.rb', line 5

def firstsheet=(value)
  @firstsheet = value
end

Instance Method Details

#activesheet_indexObject



12
13
14
# File 'lib/writeexcel/worksheets.rb', line 12

def activesheet_index
  index(@activesheet)
end

#firstsheet_indexObject



16
17
18
# File 'lib/writeexcel/worksheets.rb', line 16

def firstsheet_index
  index(@firstsheet) || 0
end

#selected_countObject



20
21
22
# File 'lib/writeexcel/worksheets.rb', line 20

def selected_count
  self.select { |sheet| sheet.selected? }.size
end