Class: Fog::Local::Directory
Instance Attribute Summary
Attributes inherited from Model
#connection
Instance Method Summary
collapse
deprecate
Methods inherited from Model
#_dump, _load, aliases, attribute, attributes, #attributes, #collection, identity, #identity, #identity=, #initialize, #inspect, #merge_attributes, #new_record?, #reload, #requires, #to_json, #wait_for
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/fog/local/models/directory.rb', line 14
def destroy
requires :key
if ::File.directory?(path)
Dir.rmdir(path)
true
else
false
end
end
|
#files ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/fog/local/models/directory.rb', line 25
def files
@files ||= begin
Fog::Local::Files.new(
:directory => self,
:connection => connection
)
end
end
|
#save ⇒ Object
34
35
36
37
38
39
|
# File 'lib/fog/local/models/directory.rb', line 34
def save
requires :key
Dir.mkdir(path)
true
end
|