Update README documentation for register_discovery_document (It returns a Hash instead of an API object, therefore we must call discovered_api to get the API object)

This commit is contained in:
theit8514 2014-09-25 11:44:12 -04:00
parent fda7086f43
commit 571b278b35
1 changed files with 6 additions and 1 deletions

View File

@ -83,8 +83,13 @@ drive = client.discovered_api('drive', 'v2')
Locally cached discovery documents may be used as well. To load an API from a local file:
```ruby
# Output discovery document to JSON
File.open('my-api.json', 'w') do |f| f.puts MultiJson.dump(client.discovery_document('myapi', 'v1')) end
# Read discovery document and load API
doc = File.read('my-api.json')
my_api = client.register_discovery_document('myapi', 'v1', doc)
client.register_discovery_document('myapi', 'v1', doc)
my_api = client.discovered_api('myapi', 'v1')
```
### Authorization