Broke the examples in the README up a bit to be less intimidating.

git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@47 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
This commit is contained in:
Bob Aman 2010-10-07 22:36:02 +00:00
parent ddc49fdd2b
commit 793e983fbe
1 changed files with 6 additions and 0 deletions

6
README
View File

@ -12,6 +12,7 @@ APIs.
== Example Usage == Example Usage
# Initialize the client
require 'google/api_client' require 'google/api_client'
require 'signet/oauth_1/client' require 'signet/oauth_1/client'
client = Google::APIClient.new( client = Google::APIClient.new(
@ -40,6 +41,11 @@ APIs.
) )
# Redirect user here # Redirect user here
client.authorization.fetch_token_credential!(:verifier => '12345') client.authorization.fetch_token_credential!(:verifier => '12345')
# Discover available methods
method_names = client.discovered_service('buzz').to_h.keys
# Make an API call
response = client.execute( response = client.execute(
'chili.activities.list', 'chili.activities.list',
{'scope' => '@self', 'userId' => '@me', 'alt' => 'json'}, {'scope' => '@self', 'userId' => '@me', 'alt' => 'json'},