Class: NCal2GCal::GoogleCalendar
- Inherits:
-
Object
- Object
- NCal2GCal::GoogleCalendar
- Defined in:
- lib/ncal2gcal/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.
10 11 12 13 14 15 16 17 18 |
# File 'lib/ncal2gcal/google_calendar.rb', line 10 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}) end |
Instance Attribute Details
#calendar ⇒ Object
Returns the value of attribute calendar.
8 9 10 |
# File 'lib/ncal2gcal/google_calendar.rb', line 8 def calendar @calendar end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
9 10 11 |
# File 'lib/ncal2gcal/google_calendar.rb', line 9 def events @events end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/ncal2gcal/google_calendar.rb', line 8 def password @password end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/ncal2gcal/google_calendar.rb', line 8 def user @user end |
Instance Method Details
#del_event(id) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ncal2gcal/google_calendar.rb', line 25 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 |