Skip to content

Commit

Permalink
Update README documentation for register_discovery_document (It retur…
Browse files Browse the repository at this point in the history
…ns a Hash instead of an API object, therefore we must call discovered_api to get the API object)
  • Loading branch information
theit8514 committed Sep 25, 2014
1 parent fda7086 commit 571b278
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 571b278

Please sign in to comment.