lib/aws/s3/s3_object.rb in aws-sdk-1.4.1 vs lib/aws/s3/s3_object.rb in aws-sdk-1.5.0

- old
+ new

@@ -202,21 +202,18 @@ # # writes zero-length data # obj.write(:metadata => { "avg-rating" => "5 stars" }) # # @overload write(options = {}) # @overload write(data, options = {}) + # @param data The data to upload (see the +:data+ option). # - # @param data The data to upload (see the +:data+ - # option). - # # @param options [Hash] Additional upload options. # # @option options :data The data to upload. Valid values include: - # * A string # + # * A string # * A Pathname object - # # * Any object responding to +read+ and +eof?+; the object # must support the following access methods: # read # all at once # read(length) until eof? # in chunks # @@ -702,11 +699,11 @@ # @option options [Range] :range A byte range to read data from # def read(options = {}, &blk) options[:bucket_name] = bucket.name options[:key] = key - client.get_object(options).data + client.get_object(options).data[:data] end # @private module ACLProxy @@ -738,16 +735,17 @@ # method. # # @return [AccessControlList] # def acl - acl = client.get_object_acl( - :bucket_name => bucket.name, - :key => key - ).acl + + resp = client.get_object_acl(:bucket_name => bucket.name, :key => key) + + acl = AccessControlList.new(resp.data) acl.extend ACLProxy acl.object = self acl + end # Sets the object's access control list. +acl+ can be: # * An XML policy as a string (which is passed to S3 uninterpreted) # * An AccessControlList object