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.



183
184
185
186
# File 'lib/s3fsr.rb', line 183

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

Instance Method Details

#bucketObject



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

def bucket
  @bucket_name
end

#deleteObject



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

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

#nameObject



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

def name
  @bucket_name
end

#path_to_key(child_key) ⇒ Object



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

def path_to_key child_key
  child_key
end