Class: Fog::Storage::Local::Directory

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/storage/local/models/directory.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/fog/storage/local/models/directory.rb', line 7

def destroy
  requires :key

  if ::File.directory?(path)
    Dir.rmdir(path)
    true
  else
    false
  end
end

#filesObject



18
19
20
21
22
23
24
25
# File 'lib/fog/storage/local/models/directory.rb', line 18

def files
  @files ||= begin
    Fog::Storage::Local::Files.new(
      :directory    => self,
      :service   => service
    )
  end
end

#public=(new_public) ⇒ Object



27
28
29
# File 'lib/fog/storage/local/models/directory.rb', line 27

def public=(new_public)
  new_public
end

#public_urlObject



31
32
33
# File 'lib/fog/storage/local/models/directory.rb', line 31

def public_url
  nil
end

#saveObject



35
36
37
38
39
40
# File 'lib/fog/storage/local/models/directory.rb', line 35

def save
  requires :key

  FileUtils.mkpath(path)
  true
end