Deleting events

18 views
Skip to first unread message

Jojo

unread,
Nov 30, 2010, 12:15:18 PM11/30/10
to gcal4ruby
Just reading over the documentation, there doesn't seem to be any
methods for deleting methods to permanently remove events.

Is there some way to delete the event from the google calendar?

I tried .destroy but that returned an undefined method.

Jojo

unread,
Nov 30, 2010, 12:33:35 PM11/30/10
to gcal4ruby
My other attempt to delete was to reassign the deleted event to a
special calendar that is marked as trash but it doesn't seem to be
responding.

account = Account.find(session[:id])

service = GCal4Ruby::Service.new
service.authenticate("meevec...@gmail.com", "jtantongco")
calendar = GCal4Ruby::Calendar.find(
service,
{:id => account.gcal})
trash_cal = GCal4Ruby::Calendar.find(
service,
{:id =>
"6h9ukoe7qac2a...@group.calendar.google.com"})
gevent = GCal4Ruby::Event.find(service, @event.title)

#no delete method in gem, .destroy doesn't seem to work
#results from trying to move the event to a trash calendar are in-
conclusive
#gevent[0].calendar = trash_cal

#settled on moving deleted events to January 31, 2000, at 12:30 pm to
12:31 pm
gevent[0].title = "Deleted"
gevent[0].start_time = Time.parse("31-01-2000 at 12:30 PM")
gevent[0].end_time = Time.parse("31-01-2000 at 12:31 PM")
gevent[0].where = "Deleted"
gevent[0].save

As can be seen in the code above, my event delete for now is to simply
assign it to a date time that waaaaay into the past.
Reply all
Reply to author
Forward
0 new messages