Class: S3::GetResponse

Inherits:
Response show all
Defined in:
lib/s3sync/S3.rb

Instance Attribute Summary collapse

Attributes inherited from Response

#http_response

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ GetResponse

Returns a new instance of GetResponse.



661
662
663
664
665
666
# File 'lib/s3sync/S3.rb', line 661

def initialize(response)
  super(response)
   = (response)
  data = response.body
  @object = S3Object.new(data, )
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



660
661
662
# File 'lib/s3sync/S3.rb', line 660

def object
  @object
end

Instance Method Details

#get_aws_metadata(response) ⇒ Object

parses the request headers and pulls out the s3 metadata into a hash



669
670
671
672
673
674
675
676
677
678
679
# File 'lib/s3sync/S3.rb', line 669

def (response)
   = {}
  response.each do |key, value|
    if key =~ /^#{METADATA_PREFIX}(.*)$/oi
      [$1] = value
    else
      [key] = value
    end
  end
  return 
end