Class: CloudSync::Media::Filesystem

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

Instance Method Summary collapse

Instance Method Details

#exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/cloud_sync/media/filesystem.rb', line 5

def exists? path
  File.exists? path
end

#is_container?(path) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/cloud_sync/media/filesystem.rb', line 9

def is_container? path
  File.directory? path
end

#is_object?(path) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cloud_sync/media/filesystem.rb', line 13

def is_object? path
  File.exists? path
end

#reader(path) ⇒ Object



17
18
19
# File 'lib/cloud_sync/media/filesystem.rb', line 17

def reader path
  File.open(path, "r")
end

#writer(path) ⇒ Object



21
22
23
# File 'lib/cloud_sync/media/filesystem.rb', line 21

def writer path
  File.open(path, "w")
end