Class: Outlook2GCal::GoogleCalendar
- Inherits:
-
Object
- Object
- Outlook2GCal::GoogleCalendar
- Defined in:
- lib/outlook2gcal/google_calendar.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
Returns the value of attribute calendar.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #del_event(id) ⇒ Object
- #find_event(id) ⇒ Object
-
#initialize(params) ⇒ GoogleCalendar
constructor
A new instance of GoogleCalendar.
- #new_event ⇒ Object
Constructor Details
#initialize(params) ⇒ GoogleCalendar
Returns a new instance of GoogleCalendar.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/outlook2gcal/google_calendar.rb', line 11 def initialize(params) @user = params[:gmail_user] @password = params[:gmail_password] @calendar = params[:gmail_calendar] || "LotusNotes" @service = GCal4Ruby::Service.new @service.authenticate(@user, @password ) @cal = GCal4Ruby::Calendar.find(@service, @calendar, {:scope => :first})[0] end |
Instance Attribute Details
#calendar ⇒ Object
Returns the value of attribute calendar.
9 10 11 |
# File 'lib/outlook2gcal/google_calendar.rb', line 9 def calendar @calendar end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
10 11 12 |
# File 'lib/outlook2gcal/google_calendar.rb', line 10 def events @events end |
#password ⇒ Object
Returns the value of attribute password.
9 10 11 |
# File 'lib/outlook2gcal/google_calendar.rb', line 9 def password @password end |
#user ⇒ Object
Returns the value of attribute user.
9 10 11 |
# File 'lib/outlook2gcal/google_calendar.rb', line 9 def user @user end |
Instance Method Details
#del_event(id) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/outlook2gcal/google_calendar.rb', line 29 def del_event(id) begin event = find_event(id) if event return event.delete unless event == [] end rescue StandardError => e print 'X' $logger.error DateTime.now.to_s $logger.error id $logger.error e end return false end |