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.
Attributes inherited from Google::Cloud::Storage::File
Instance Method Summary collapse
- #check_for_changed_metadata! ⇒ Object
-
#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, from_gapi, #generation, #id, #kind, #md5, #media_url, #metageneration, #name, #public_url, #reload!, #signed_url, #size, #to_gs_url, #update, #updated_at
Constructor Details
#initialize(gapi) ⇒ Updater
Create an Updater object.
806 807 808 809 |
# File 'lib/google/cloud/storage/file.rb', line 806 def initialize gapi @updates = [] @gapi = gapi end |
Instance Attribute Details
#updates ⇒ Object (readonly)
Returns the value of attribute updates.
803 804 805 |
# File 'lib/google/cloud/storage/file.rb', line 803 def updates @updates end |
Instance Method Details
#check_for_changed_metadata! ⇒ Object
832 833 834 835 836 |
# File 'lib/google/cloud/storage/file.rb', line 832 def return if @metadata == @gapi. @gapi. = @metadata patch_gapi! :metadata end |
#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.
815 816 817 818 |
# File 'lib/google/cloud/storage/file.rb', line 815 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.
824 825 826 827 828 |
# File 'lib/google/cloud/storage/file.rb', line 824 def @metadata = @gapi. = @metadata patch_gapi! :metadata end |