Class: Excel::App
- Inherits:
-
Object
- Object
- Excel::App
- Defined in:
- lib/Excel/app.rb
Class Method Summary collapse
- .app_object ⇒ Object
- .close ⇒ Object
- .open(params) ⇒ Object
- .save_all ⇒ Object
- .workbook(wb) ⇒ Object
- .workbooks ⇒ Object
- .workbooks_paths ⇒ Object
Class Method Details
.app_object ⇒ Object
14 15 16 |
# File 'lib/Excel/app.rb', line 14 def self.app_object @app_object end |
.close ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/Excel/app.rb', line 43 def self.close app_object.run app_object.activate app_object.workbooks.saved.set(true) app_object.workbooks.close app_object.quit end |
.open(params) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/Excel/app.rb', line 18 def self.open(params) file_path = MacTypes::Alias.path(params[:path]) app_object.run app_object.activate app_object.open file_path File.basename(file_path.path) end |
.save_all ⇒ Object
51 52 53 |
# File 'lib/Excel/app.rb', line 51 def self.save_all app_object.save end |
.workbook(wb) ⇒ Object
38 39 40 41 |
# File 'lib/Excel/app.rb', line 38 def self.workbook wb # raise "Workbook not found" if !(workbooks.include? wb) WorkBook.new(self, wb) end |
.workbooks ⇒ Object
28 29 30 31 |
# File 'lib/Excel/app.rb', line 28 def self.workbooks return [] if app_object.workbooks.get == :missing_value app_object.workbooks.get.collect {|wb| wb.name.get } end |
.workbooks_paths ⇒ Object
33 34 35 36 |
# File 'lib/Excel/app.rb', line 33 def self.workbooks_paths return [] if app_object.workbooks.get == :missing_value app_object.workbooks.get.collect {|wb| "#{MacTypes::FileURL.hfs_path(wb.path.get).path}/#{wb.name.get}" } end |