Merge pull request #162 from theit8514/master
authorSteve Bazyl <sqrrrl@gmail.com>
Sat, 6 Dec 2014 00:52:15 +0000 (16:52 -0800)
committerSteve Bazyl <sqrrrl@gmail.com>
Sat, 6 Dec 2014 00:52:15 +0000 (16:52 -0800)
Update README example for register_discovery_document

1  2 
README.md

diff --combined README.md
index 33211c8987491c6d6034ee7402c7d43909eea314,43b40b71d4de4f63056bb9088527a9690fa61875..04ed0b0620a7c73254eb3d02a59500acaabb8dbe
+++ b/README.md
  The Google API Ruby Client makes it trivial to discover and access supported
  APIs.
  
 +## Alpha
 +
 +This library is in Alpha. We will make an effort to support the library, but we reserve the right to make incompatible changes when necessary.
 +
  ## Install
  
  Be sure `https://rubygems.org/` is in your gem sources.
@@@ -87,8 -83,13 +87,13 @@@ drive = client.discovered_api('drive', 
  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