Skip to content

Commit

Permalink
Merge pull request googleapis#162 from theit8514/master
Browse files Browse the repository at this point in the history
Update README example for register_discovery_document
  • Loading branch information
sqrrrl committed Dec 6, 2014
2 parents 3a295bf + 571b278 commit 16683c7
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 @@ -87,8 +87,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 16683c7

Please sign in to comment.