lib/google/cloud/storage/file.rb in google-cloud-storage-1.30.0 vs lib/google/cloud/storage/file.rb in google-cloud-storage-1.31.0
- old
+ new
@@ -189,11 +189,11 @@
# Content-Length of the data in bytes.
#
# @return [Integer]
#
def size
- @gapi.size.to_i if @gapi.size
+ @gapi.size&.to_i
end
##
# Creation time of the file.
#
@@ -1871,11 +1871,11 @@
update_gapi = self.class.gapi_from_attrs @gapi, attributes
return if update_gapi.nil?
ensure_service!
- rewrite_attrs = %i[storage_class kms_key_name]
+ rewrite_attrs = [:storage_class, :kms_key_name]
@gapi = if attributes.any? { |a| rewrite_attrs.include? a }
rewrite_gapi \
bucket, name, update_gapi, user_project: user_project
else
service.patch_file \
@@ -1970,9 +1970,10 @@
].freeze
##
# @private Create an Updater object.
def initialize gapi
+ super()
@updates = []
@gapi = gapi
@metadata ||= @gapi.metadata.to_h.dup
end