Class: FakeAWS::S3::ObjectCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fake_aws/s3/object_collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(bucket) ⇒ ObjectCollection

Returns a new instance of ObjectCollection.



9
10
11
12
13
14
# File 'lib/fake_aws/s3/object_collection.rb', line 9

def initialize(bucket)
  @bucket = bucket
  @objects = Hash.new do |h, key|
    h[key] = S3Object.new(self, key)
  end
end

Instance Method Details

#[](key) ⇒ Object



16
17
18
19
# File 'lib/fake_aws/s3/object_collection.rb', line 16

def [](key)
  key = key.to_s
  @objects[key]
end