Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
undefined method(s) in a gcalapi class
Kevin Lee
6/28/2007 6:15:00 PM
Hi, I am using the gcalapi v 0.1.0 library and ran into a error when I
called the add action. It generated "NoMethodError in
EventController#Add undefined method `insert' for
GoogleCalendar::ServiceBase:Class" error message.
I tried other methods in the googlecalendar/service_base class but got
the same error. The class file is correctly installed and using methods
of other classes do not cause this problem. I am dumbfounded. Is this
a configuration problem?
My rails version is 1.2.3 and ruby version is 1.8.6. Please help!
Below is code to illustrate my problem:
require "..."
require "googlecalendar/service_auth_sub"
require "googlecalendar/auth_sub_util"
require "googlecalendar/calendar"
require "googlecalendar/service"
require "googlecalendar/service_base"
REQUEST_URL = "
https://www.google.com/accounts/AuthSubReq...
SESSION_URL = "
https://www.google.com/accounts/AuthSubSessionT...
REVOKE_URL = "
https://www.google.com/accounts/AuthSubRevokeT...
INFO_URL = "
https://www.google.com/accounts/AuthSubToken...
CALENDAR_SCOPE = "
http://www.google.com/calendar/fe...
DEFAULT_CALENDAR_FEED =
"
http://www.google.com/calendar/feeds/default/private/...
MAIL = "my_email_address"
PASS = "my_password"
FEED =
"
http://www.google.com/calendar/feeds/my_email_address/private/...
class EventController < ApplicationController
def Add
...
request_url =
GoogleCalendar::AuthSubUtil.build_request_url("
http://127.0.0.1:3000/event/i...
,
"
http://www.google.com/calendar/fe...
, 0, 1)
...
one_time_token =
GoogleCalendar::AuthSubUtil.get_one_time_token(page.links.first.href)
...
srv = GoogleCalendar::ServiceAuthSub.new(one_time_token)
ret = srv.query(FEED, {})
cal = GoogleCalendar::Calendar.new(GoogleCalendar::Service.new(MAIL,
PASS), DEFAULT_CALENDAR_FEED)
...
GoogleCalendar::ServiceBase.insert(FEED, event)
end
end
Thanks in advance!
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
undefined method(s) in a gcalapi class
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password