Class: Canistor::Storage::Object::CopyObjectResult
- Inherits:
-
Object
- Object
- Canistor::Storage::Object::CopyObjectResult
- Defined in:
- lib/canistor/storage/object.rb
Overview
Renders the result of a copy request.
Class Method Summary collapse
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(source_object, object) ⇒ CopyObjectResult
constructor
A new instance of CopyObjectResult.
- #to_xml ⇒ Object
Constructor Details
#initialize(source_object, object) ⇒ CopyObjectResult
Returns a new instance of CopyObjectResult.
10 11 12 |
# File 'lib/canistor/storage/object.rb', line 10 def initialize(source_object, object) @source_object, @object = source_object, object end |
Class Method Details
.serve(context, subject, source_object, object) ⇒ Object
29 30 31 32 33 |
# File 'lib/canistor/storage/object.rb', line 29 def self.serve(context, subject, source_object, object) result = new(source_object, object) context.http_response.signal_headers(200, result.headers) context.http_response.signal_data(result.to_xml) end |
Instance Method Details
#headers ⇒ Object
14 15 16 17 18 |
# File 'lib/canistor/storage/object.rb', line 14 def headers @object.identity_headers.merge( 'x-amz-copy-source-version-id' => @source_object.version_id ) end |
#to_xml ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/canistor/storage/object.rb', line 20 def to_xml Nokogiri::XML::Builder.new do |xml| xml.CopyObjectResult do xml.LastModified @object.last_modified xml.ETag @object.etag end end.to_xml end |