Ruby on rails 如何获取和编辑谷歌日历事件?轨道

Ruby on rails 如何获取和编辑谷歌日历事件?轨道,ruby-on-rails,ruby,google-calendar-api,google-api-client,Ruby On Rails,Ruby,Google Calendar Api,Google Api Client,我有以下代码: client = Google::APIClient.new oauth_yaml = YAML.load_file('lib/.google-api.yaml') client = Google::APIClient.new client.authorization.client_id = oauth_yaml["client_id"] client.authorization.client_secret = oauth_yaml["client_secret"] clien

我有以下代码:

client = Google::APIClient.new

oauth_yaml = YAML.load_file('lib/.google-api.yaml')
client = Google::APIClient.new
client.authorization.client_id = oauth_yaml["client_id"]
client.authorization.client_secret = oauth_yaml["client_secret"]
client.authorization.scope = oauth_yaml["scope"]
client.authorization.refresh_token = oauth_yaml["refresh_token"]
client.authorization.access_token = oauth_yaml["access_token"]

if client.authorization.refresh_token && client.authorization.expired?
  client.authorization.fetch_access_token!
end

service = client.discovered_api('calendar', 'v3')

result = client.execute(:api_method => service.settings.list)
它正在工作:)但是,有人能给我举个例子或链接给我看吗:)我如何获取用户事件并更新它们?

rails -v
Rails 3.2.13

ruby -v
ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0]
我的档案:

gem 'google-api-client'
gem 'googlecalendar'
gem 'gdata'
gem 'sinatra'
gem 'logger'
gem 'gdata_19'
非常感谢。

我用了这个,效果很好

但它不使用谷歌API,只需使用Gmail帐户和密码登录并解析其响应

所以我想知道这块宝石对你有好处。无论如何,试试看。

谢谢你,伙计:)是的,很好:)但有人告诉我要用另一个->:)因为,客户不想输入邮件和通行证:)