lib/fog/aliyun/models/storage/file.rb in fog-aliyun-0.3.10 vs lib/fog/aliyun/models/storage/file.rb in fog-aliyun-0.3.11
- old
+ new
@@ -1,12 +1,12 @@
# frozen_string_literal: true
require 'fog/core/model'
module Fog
- module Storage
- class Aliyun
+ module Aliyun
+ class Storage
class File < Fog::Model
identity :key, aliases: ['Key', 'Name', 'name']
attribute :date, aliases: 'Date'
attribute :content_length, aliases: 'Content-Length', type: :integer
attribute :content_type, aliases: 'Content-Type'
@@ -122,10 +122,10 @@
if body.is_a?(::File)
data = service.put_object(object, body, options.merge(bucket: bucket_name)).data
elsif body.is_a?(String)
data = service.put_object_with_body(object, body, options.merge(bucket: bucket_name)).data
else
- raise Fog::Storage::Aliyun::Error, " Forbidden: Invalid body type: #{body.class}!"
+ raise Fog::Aliyun::Storage::Error, " Forbidden: Invalid body type: #{body.class}!"
end
update_attributes_from(data)
refresh_metadata
self.content_length = Fog::Storage.get_body_size(body)