Class: Fog::Storage::Local::Directory
- Inherits:
-
Model
- Object
- Model
- Fog::Storage::Local::Directory
show all
- Defined in:
- lib/fog/storage/models/local/directory.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #connection
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #inspect, #reload, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/fog/storage/models/local/directory.rb', line 12
def destroy
requires :key
if ::File.directory?(path)
Dir.rmdir(path)
true
else
false
end
end
|
#files ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/fog/storage/models/local/directory.rb', line 23
def files
@files ||= begin
Fog::Storage::Local::Files.new(
:directory => self,
:connection => connection
)
end
end
|
#public=(new_public) ⇒ Object
32
33
34
|
# File 'lib/fog/storage/models/local/directory.rb', line 32
def public=(new_public)
new_public
end
|
#public_url ⇒ Object
36
37
38
|
# File 'lib/fog/storage/models/local/directory.rb', line 36
def public_url
nil
end
|
#save ⇒ Object
40
41
42
43
44
45
|
# File 'lib/fog/storage/models/local/directory.rb', line 40
def save
requires :key
Dir.mkdir(path)
true
end
|