Class: Google::Cloud::Storage::File::Updater
- Inherits:
-
Google::Cloud::Storage::File
- Object
- Google::Cloud::Storage::File
- Google::Cloud::Storage::File::Updater
- Defined in:
- lib/google/cloud/storage/file.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.
Instance Method Summary collapse
-
#initialize(gapi) ⇒ Updater
constructor
Create an Updater object.
-
#metadata ⇒ Object
A hash of custom, user-provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.
-
#metadata=(metadata) ⇒ Object
Updates the hash of custom, user-provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.
Methods inherited from Google::Cloud::Storage::File
#acl, #api_url, #bucket, #cache_control, #cache_control=, #content_disposition, #content_disposition=, #content_encoding, #content_encoding=, #content_language, #content_language=, #content_type, #content_type=, #copy, #crc32c, #created_at, #delete, #download, #encryption_key_sha256, #etag, #generation, #id, #kind, #md5, #media_url, #metageneration, #name, #public_url, #reload!, #signed_url, #size, #update, #updated_at
Constructor Details
#initialize(gapi) ⇒ Updater
Create an Updater object.
800 801 802 803 |
# File 'lib/google/cloud/storage/file.rb', line 800 def initialize gapi @updates = [] @gapi = gapi end |
Instance Attribute Details
#updates ⇒ Object (readonly)
Returns the value of attribute updates
797 798 799 |
# File 'lib/google/cloud/storage/file.rb', line 797 def updates @updates end |
Instance Method Details
#metadata ⇒ Object
A hash of custom, user-provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.
809 810 811 812 |
# File 'lib/google/cloud/storage/file.rb', line 809 def # do not freeze metadata @metadata ||= @gapi..to_h.dup end |
#metadata=(metadata) ⇒ Object
Updates the hash of custom, user-provided web-safe keys and arbitrary string values that will returned with requests for the file as "x-goog-meta-" response headers.
818 819 820 821 822 |
# File 'lib/google/cloud/storage/file.rb', line 818 def @metadata = @gapi. = @metadata patch_gapi! :metadata end |