Class: CloudSync::Media::Rackspace

Inherits:
Base
  • Object
show all
Defined in:
lib/cloud_sync/media/rackspace.rb

Instance Method Summary collapse

Constructor Details

#initializeRackspace

Returns a new instance of Rackspace.



13
14
15
16
17
# File 'lib/cloud_sync/media/rackspace.rb', line 13

def initialize
  raise "rackspace_user not set" unless Configuration.rackspace_user
  raise "rackspace_key not set"  unless Configuration.rackspace_key
  @conn = CloudFiles::Connection.new(Configuration.rackspace_user, Configuration.rackspace_key)
end

Instance Method Details

#exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/cloud_sync/media/rackspace.rb', line 23

def exists? path
  container, object = parse path
  object_exists?(container, object)
end

#list(container) ⇒ Object



19
20
21
# File 'lib/cloud_sync/media/rackspace.rb', line 19

def list container
  @conn.container(container).objects
end

#reader(path) ⇒ Object



28
29
30
31
# File 'lib/cloud_sync/media/rackspace.rb', line 28

def reader path
  container, object = parse path
  get_object(container, object)
end

#writer(path) ⇒ Object



33
34
35
36
# File 'lib/cloud_sync/media/rackspace.rb', line 33

def writer path
  container, object = parse path
  get_object(container, object)
end