Method: FakeS3::FileStore#initialize

Defined in:
lib/fakes3/file_store.rb

#initialize(root) ⇒ FileStore

Returns a new instance of FileStore.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fakes3/file_store.rb', line 18

def initialize(root)
  @root = root
  @buckets = []
  @bucket_hash = {}
  Dir[File.join(root,"*")].each do |bucket|
    bucket_name = File.basename(bucket)
    bucket_obj = Bucket.new(bucket_name,Time.now,[])
    @buckets << bucket_obj
    @bucket_hash[bucket_name] = bucket_obj
  end
end