Class: CephStorage::StorageObject::URLStorageObject

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

Overview

Remote URL Storage Object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CephStorage::StorageObject

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

Constructor Details

#initialize(url) ⇒ URLStorageObject

Returns a new instance of URLStorageObject.



9
10
11
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 9

def initialize(url)
  self.name = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#destroyObject



29
30
31
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 29

def destroy
  raise 'Unsupported file operation'
end

#nameObject



13
14
15
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 13

def name
  url
end

#pathObject



17
18
19
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 17

def path
  url
end

#read_fileObject



21
22
23
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 21

def read_file
  open(url).read
end

#write_file(_contents) ⇒ Object



25
26
27
# File 'lib/ceph_storage/storage_object/url_storage_object.rb', line 25

def write_file(_contents)
  raise 'Unsupported file operation'
end