Ruby google-cloud-storage

From wikinotes
Revision as of 15:54, 1 April 2023 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation

api docs https://cloud.google.com/ruby/docs/reference/google-cloud-storage/latest

Usage

project = Google::Cloud::Storage.new(project_id: "foo")
bucket = project.bucket("my_bucket")

bucket.upload_file(StringIO.new("hi"), "/some/path.txt")
bucket.create_file("/some/path.txt")
bucket.file("/some/path.txt").download  # => StringIO