Class: Google::Cloud::Storage::Bucket::Updater
- Inherits:
-
Google::Cloud::Storage::Bucket
- Object
- Google::Cloud::Storage::Bucket
- Google::Cloud::Storage::Bucket::Updater
- Defined in:
- lib/google/cloud/storage/bucket.rb
Overview
Yielded to a block to accumulate changes for a patch request.
Instance Attribute Summary collapse
-
#updates ⇒ Object
readonly
Returns the value of attribute updates.
Attributes inherited from Google::Cloud::Storage::Bucket
Instance Method Summary collapse
- #cors {|@cors_builder| ... } ⇒ Object
-
#initialize(gapi) ⇒ Updater
constructor
Create an Updater object.
-
#labels ⇒ Object
A hash of user-provided labels.
-
#labels=(labels) ⇒ Object
Updates the hash of user-provided labels.
Methods inherited from Google::Cloud::Storage::Bucket
#acl, #api_url, #create_file, #created_at, #default_acl, #delete, #exists?, #file, #files, #id, #kind, #location, #logging_bucket, #logging_bucket=, #logging_prefix, #logging_prefix=, #name, #policy, #policy=, #post_object, #reload!, #requester_pays, #requester_pays=, #signed_url, #storage_class, #storage_class=, #test_permissions, #update, #versioning=, #versioning?, #website_404, #website_404=, #website_main, #website_main=
Constructor Details
#initialize(gapi) ⇒ Updater
Create an Updater object.
1250 1251 1252 1253 1254 1255 |
# File 'lib/google/cloud/storage/bucket.rb', line 1250 def initialize gapi @updates = [] @gapi = gapi @labels = @gapi.labels.to_h.dup @cors_builder = nil end |
Instance Attribute Details
#updates ⇒ Object (readonly)
Returns the value of attribute updates
1247 1248 1249 |
# File 'lib/google/cloud/storage/bucket.rb', line 1247 def updates @updates end |
Instance Method Details
#cors {|@cors_builder| ... } ⇒ Object
1279 1280 1281 1282 1283 1284 |
# File 'lib/google/cloud/storage/bucket.rb', line 1279 def cors # Same as Bucket#cors, but not frozen @cors_builder ||= Bucket::Cors.from_gapi @gapi.cors_configurations yield @cors_builder if block_given? @cors_builder end |
#labels ⇒ Object
A hash of user-provided labels. Changes are allowed.
1259 1260 1261 |
# File 'lib/google/cloud/storage/bucket.rb', line 1259 def labels @labels end |
#labels=(labels) ⇒ Object
Updates the hash of user-provided labels.
1265 1266 1267 1268 1269 |
# File 'lib/google/cloud/storage/bucket.rb', line 1265 def labels= labels @labels = labels @gapi.labels = @labels patch_gapi! :labels end |