Class: Rxls::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rxls/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Base

Returns a new instance of Base.



5
6
7
8
9
10
11
12
13
# File 'lib/rxls/base.rb', line 5

def initialize file
  @obj = begin 
    WIN32OLE.connect('excel.application')
  rescue
    WIN32OLE.new('excel.application')
  end
  file = File.expand_path "../../../test/fixtures/#{file}.xls", __FILE__ if file.kind_of? Symbol
  @obj.workbooks.open file
end

Instance Method Details

#quitObject



15
16
17
# File 'lib/rxls/base.rb', line 15

def quit
  @obj.quit
end

#worksheet(n, mapping = nil) ⇒ Object



19
20
21
# File 'lib/rxls/base.rb', line 19

def worksheet(n,mapping=nil)
  Worksheet.new(@obj,n,mapping)
end