Method: RightAws::S3::Key#initialize
- Defined in:
- lib/s3/right_s3.rb
#initialize(bucket, name, data = nil, headers = {}, meta_headers = {}, last_modified = nil, e_tag = nil, size = nil, storage_class = nil, owner = nil) ⇒ Key
Create a new Key instance, but do not create the actual key. In normal use this method should not be called directly. Use RightAws::S3::Key.create or bucket.key() instead.
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/s3/right_s3.rb', line 412 def initialize(bucket, name, data=nil, headers={}, ={}, last_modified=nil, e_tag=nil, size=nil, storage_class=nil, owner=nil) raise 'Bucket must be a Bucket instance.' unless bucket.is_a?(Bucket) @bucket = bucket @name = name @data = data @e_tag = e_tag @size = size.to_i @storage_class = storage_class @owner = owner @last_modified = last_modified if @last_modified && !@last_modified.is_a?(Time) @last_modified = Time.parse(@last_modified) end @headers, @meta_headers = self.class.(headers) @meta_headers.merge!() end |