Class: Excel::WorkBook

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

Class Method Summary collapse

Class Method Details

.app_objectObject



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

def self.app_object
  @app_object.app_object
end

.closeObject



22
23
24
25
# File 'lib/Excel/workbook.rb', line 22

def self.close
  app_object.workbooks[workbook_name].saved.set(true)
  app_object.workbooks[workbook_name].close
end

.new(app, wb_name) ⇒ Object



8
9
10
11
12
# File 'lib/Excel/workbook.rb', line 8

def self.new(app, wb_name)
  @app_object = app
  @workbook_name = wb_name
  self
end

.saveObject



36
37
38
# File 'lib/Excel/workbook.rb', line 36

def self.save
  app_object.workbooks[workbook_name].save
end

.workbook_nameObject



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

def self.workbook_name
  @workbook_name
end

.worksheet(ws) ⇒ Object



31
32
33
34
# File 'lib/Excel/workbook.rb', line 31

def self.worksheet ws
  # raise "Worksheet not found" if !(worksheets.include? ws)
  WorkSheet.new(self, ws)
end

.worksheetsObject



27
28
29
# File 'lib/Excel/workbook.rb', line 27

def self.worksheets
  app_object.workbooks[workbook_name].worksheets.get.collect {|ws| ws.name.get }
end