Class: CephStorage::StorageObject::FileStorageObject

Inherits:
File
  • Object
show all
Includes:
CephStorage::StorageObject
Defined in:
lib/ceph_storage/storage_object/file_storage_object.rb

Overview

File Storage Object

Instance Method Summary collapse

Methods included from CephStorage::StorageObject

#copy, #copy_xattrs, #log, #move, supports_xattr?, #xattr_supported?

Instance Method Details

#destroyObject



23
24
25
# File 'lib/ceph_storage/storage_object/file_storage_object.rb', line 23

def destroy
  File.unlink(path)
end

#nameObject



7
8
9
# File 'lib/ceph_storage/storage_object/file_storage_object.rb', line 7

def name
  path
end

#read_fileObject



11
12
13
14
15
# File 'lib/ceph_storage/storage_object/file_storage_object.rb', line 11

def read_file
  buf = read
  rewind
  buf
end

#write_file(contents) ⇒ Object



17
18
19
20
21
# File 'lib/ceph_storage/storage_object/file_storage_object.rb', line 17

def write_file(contents)
  write(contents)
  flush
  rewind
end