Class: SBucketsDir
Instance Method Summary
collapse
Methods inherited from SBaseDir
#content_deleted, #contents, #get, #is_directory?, #is_file?, #size, #touch
Constructor Details
Returns a new instance of SBucketsDir.
208
209
210
|
# File 'lib/s3fsr.rb', line 208
def initialize
@data = nil
end
|
Instance Method Details
#can_write_files? ⇒ Boolean
211
212
213
|
# File 'lib/s3fsr.rb', line 211
def can_write_files?
false
end
|
#create_dir(child_key) ⇒ Object
217
218
219
220
221
|
# File 'lib/s3fsr.rb', line 217
def create_dir child_key
AWS::S3::Bucket.create(child_key)
d = SBucketDir.new(self, child_key)
get_contents[d.name] = d
end
|
#create_file(child_key, content) ⇒ Object
214
215
216
|
# File 'lib/s3fsr.rb', line 214
def create_file child_key, content
raise 'cannot create files outside of a bucket'
end
|
#delete ⇒ Object
222
223
224
|
# File 'lib/s3fsr.rb', line 222
def delete
raise 'cannot delete the buckets dir'
end
|
#name ⇒ Object
225
226
227
|
# File 'lib/s3fsr.rb', line 225
def name
return 'buckets'
end
|
#path_to_key(child_key) ⇒ Object
228
229
230
231
232
|
# File 'lib/s3fsr.rb', line 228
def path_to_key child_key
i = child_key.index('/')
i != nil ? child_key[i+1..-1] : child_key
end
|