lib/fog/aws/models/s3/object.rb in fog-0.0.25 vs lib/fog/aws/models/s3/object.rb in fog-0.0.26
- old
+ new
@@ -2,15 +2,16 @@
module AWS
class S3
class Object < Fog::Model
+ identity :key, 'Key'
+
attribute :body
attribute :content_length, 'Content-Length'
attribute :content_type, 'Content-Type'
attribute :etag, ['Etag', 'ETag']
- attribute :key, 'Key'
attribute :last_modified, ['Last-Modified', 'LastModified']
attribute :owner
attribute :size, 'Size'
attribute :storage_class, 'StorageClass'
@@ -35,32 +36,19 @@
def destroy
connection.delete_object(bucket.name, @key)
true
end
- def objects
- @objects
- end
-
- def reload
- new_attributes = objects.get(@key).attributes
- merge_attributes(new_attributes)
- end
-
def save(options = {})
data = connection.put_object(bucket.name, @key, @body, options)
@etag = data.headers['ETag']
true
end
private
def bucket=(new_bucket)
@bucket = new_bucket
- end
-
- def objects=(new_objects)
- @objects = new_objects
end
end
end