Class: Google::Cloud::Storage::File::Updater

Inherits:
Google::Cloud::Storage::File show all
Defined in:
lib/google/cloud/storage/file.rb

Overview

Yielded to a block to accumulate changes for a patch request.

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



805
806
807
808
# File 'lib/google/cloud/storage/file.rb', line 805

def initialize gapi
  @updates = []
  @gapi = gapi
end

Instance Attribute Details

#updatesObject (readonly)

Returns the value of attribute updates



802
803
804
# File 'lib/google/cloud/storage/file.rb', line 802

def updates
  @updates
end

Instance Method Details

#metadataObject

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.



814
815
816
817
# File 'lib/google/cloud/storage/file.rb', line 814

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.



823
824
825
826
827
# File 'lib/google/cloud/storage/file.rb', line 823

def metadata= 
  @metadata = 
  @gapi. = @metadata
  patch_gapi! :metadata
end