Skip to content

Commit

Permalink
Merge pull request #116 from serena-w/serena-bucket-doc
Browse files Browse the repository at this point in the history
Add documentation for `service.bucket`
  • Loading branch information
Arthur Nogueira Neves committed Jul 26, 2016
2 parents ec57063 + eff439e commit a302c0a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ It supports *all* S3 regions through the {REST API}[http://docs.amazonwebservice
first_bucket = service.buckets.find("first-bucket")
#=> #<S3::Bucket:first-bucket>

or

first_bucket = service.bucket("first-bucket")
#=> #<S3::Bucket:first-bucket>

<tt>service.bucket("first-bucket")</tt> does not check whether a bucket with the name <tt>"first-bucket"</tt> exists, but it also does not issue any HTTP requests. Thus, the second example is much faster than <tt>buckets.find</tt>. You can use <tt>first_bucket.exists?</tt> to check whether the bucket exists after calling <tt>service.bucket</tt>.

=== Create bucket

new_bucket = service.buckets.build("newbucketname")
Expand Down

0 comments on commit a302c0a

Please sign in to comment.