Simple as XOauthSession.access_token
.
Setup your app at Google developer console. There you follow the menu "APIs & auth" > "Credentials". Click "Create new Client ID" and select "Installed Application" and then "Other". Download oauth2.py and execute the following with the credentials of the Google Developer console.
python oauth2.py --generate_oauth2_token --client_id=<client_id> --client_secret=<client_secret>
Follow its instructions and use the tokens there to create your initial yaml file.
require "xoauth_session"
XOauthSession.new("client_id", "client_secret", "refresh_token", nil, nil).save
This will create a file like the following:
--- !ruby/struct:XOAuthSession
client_id: <client_id>
client_secret: <client_secret>
refresh_token: <refresh_token>
access_token: <access_token>
expires_at: 2015-06-03 20:21:29.350315000 +02:00