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


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

def initialize
  @activesheet = nil
end

Instance Attribute Details

#activesheetObject

Returns the value of attribute activesheet


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

def activesheet
  @activesheet
end

#firstsheet=(value) ⇒ Object (writeonly)

Sets the attribute firstsheet

Parameters:

  • value

    the value to set the attribute firstsheet to.


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

def firstsheet=(value)
  @firstsheet = value
end

Instance Method Details

#activesheet_indexObject


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

def activesheet_index
  index(@activesheet)
end

#firstsheet_indexObject


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

def firstsheet_index
  index(@firstsheet) || 0
end

#selected_countObject


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

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