Class: Outlook2GCal::OutlookCalendar

Inherits:
Object
  • Object
show all
Defined in:
lib/outlook2gcal/outlook_calendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ OutlookCalendar

Returns a new instance of OutlookCalendar.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/outlook2gcal/outlook_calendar.rb', line 17

def initialize(params)
  @server = params[:notes_server] || '' # local
  @user = params[:notes_user] 
  @password = params[:notes_password] 
  @db = params[:notes_db] 
  
  created = false
  @ol = nil
  begin 
    @ol = WIN32OLE.connect("Outlook.Application") 
  rescue 
    @created = true
    @ol = WIN32OLE.new("Outlook.Application") 
  end
  ns = @ol.GetNameSpace("MAPI")
  folder = ns.GetDefaultFolder(9) #olFolderCalendar
  raise "olFolderCalendar View not found" unless folder
  @events = OutlookEvents.new(folder)

end

Instance Attribute Details

#dbObject

Returns the value of attribute db.



15
16
17
# File 'lib/outlook2gcal/outlook_calendar.rb', line 15

def db
  @db
end

#eventsObject (readonly)

Returns the value of attribute events.



16
17
18
# File 'lib/outlook2gcal/outlook_calendar.rb', line 16

def events
  @events
end

#passwordObject

Returns the value of attribute password.



15
16
17
# File 'lib/outlook2gcal/outlook_calendar.rb', line 15

def password
  @password
end

#serverObject

Returns the value of attribute server.



15
16
17
# File 'lib/outlook2gcal/outlook_calendar.rb', line 15

def server
  @server
end

#userObject

Returns the value of attribute user.



15
16
17
# File 'lib/outlook2gcal/outlook_calendar.rb', line 15

def user
  @user
end

Instance Method Details

#quitObject



37
38
39
# File 'lib/outlook2gcal/outlook_calendar.rb', line 37

def quit
  @ol.Quit if @created             # TODO
end