Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sqrrrl committed Jan 22, 2016
2 parents 5e0ca26 + f6aa6b0 commit 3d4ec29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -139,7 +139,7 @@ to replace. For example:

```ruby
file = {id: '123', title: 'My document', labels: { starred: true }}
file = drive.insert_file(file) # Returns a Drive::File instance
file = drive.create_file(file, {}) # Returns a Drive::File instance
```

is equivalent to:
Expand All @@ -150,6 +150,15 @@ file.labels = Drive::File::Labels.new(starred: true)
file = drive.update_file(file) # Returns a Drive::File instance
```

IMPORTANT: Be careful when supplying hashes for request objects. If it is the last argument to a method, ruby will interpret the hash as keyword arguments. To prevent this, appending an empty hash as an extra parameter will avoid misinterpretation.

```ruby
file = {id: '123', title: 'My document', labels: { starred: true }}
file = drive.create_file(file) # Raises ArgumentError: unknown keywords: id, title, labels
file = drive.create_file(file, {}) # Returns a Drive::File instance
```


## Authorization

[OAuth 2](https://developers.google.com/accounts/docs/OAuth2) is used to authorize applications. This library uses
Expand Down

0 comments on commit 3d4ec29

Please sign in to comment.