Class: Gcloud::Storage::File::Updater
- Inherits:
-
Object
- Object
- Gcloud::Storage::File::Updater
- Defined in:
- lib/gcloud/storage/file.rb
Overview
Yielded to a block to accumulate changes for a patch request.
Constant Summary collapse
- ATTRS =
[:cache_control, :content_disposition, :content_encoding, :content_language, :content_type, :metadata]
Instance Attribute Summary collapse
-
#updates ⇒ Object
readonly
Returns the value of attribute updates.
Instance Method Summary collapse
-
#initialize(metadata) ⇒ Updater
constructor
Create an Updater object.
-
#metadata ⇒ Object
Return metadata for mutation.
Constructor Details
#initialize(metadata) ⇒ Updater
Create an Updater object.
810 811 812 813 814 815 816 817 |
# File 'lib/gcloud/storage/file.rb', line 810 def initialize @metadata = if .nil? {} else .dup end @updates = {} end |
Instance Attribute Details
#updates ⇒ Object (readonly)
Returns the value of attribute updates.
807 808 809 |
# File 'lib/gcloud/storage/file.rb', line 807 def updates @updates end |
Instance Method Details
#metadata ⇒ Object
Return metadata for mutation. Also adds metadata to @updates so that it is included in the patch request.
831 832 833 |
# File 'lib/gcloud/storage/file.rb', line 831 def updates[:metadata] ||= @metadata end |