Class: SBucketDir

Inherits:
SBaseDir show all
Defined in:
lib/s3fsr.rb

Instance Method Summary collapse

Methods inherited from SBaseDir

#can_write_files?, #content_deleted, #contents, #create_dir, #create_file, #get, #is_directory?, #is_file?, #size, #touch

Constructor Details

#initialize(parent, bucket_name) ⇒ SBucketDir

Returns a new instance of SBucketDir.



187
188
189
190
# File 'lib/s3fsr.rb', line 187

def initialize(parent, bucket_name)
  @parent = parent # either SBucketsDir or nil
  @bucket_name = bucket_name
end

Instance Method Details

#bucketObject



196
197
198
# File 'lib/s3fsr.rb', line 196

def bucket
  @bucket_name
end

#deleteObject



191
192
193
194
195
# File 'lib/s3fsr.rb', line 191

def delete
  raise "cannot delete bucket dir #{name}" if @parent == nil
  AWS::S3::Bucket.delete name
  @parent.content_deleted name
end

#nameObject



199
200
201
# File 'lib/s3fsr.rb', line 199

def name
  @bucket_name
end

#path_to_key(child_key) ⇒ Object



202
203
204
# File 'lib/s3fsr.rb', line 202

def path_to_key child_key
  child_key
end