Class: S3::GetResponse

Inherits:
Response show all
Defined in:
lib/s3-ruby.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.



610
611
612
613
614
615
# File 'lib/s3-ruby.rb', line 610

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.



609
610
611
# File 'lib/s3-ruby.rb', line 609

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



618
619
620
621
622
623
624
625
626
# File 'lib/s3-ruby.rb', line 618

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