Class: Fog::Local::Directories
- Inherits:
-
Collection
- Object
- Array
- Collection
- Fog::Local::Directories
- Defined in:
- lib/fog/local/models/directories.rb
Instance Method Summary collapse
Methods inherited from Collection
#_dump, _load, aliases, attribute, attributes, #attributes, #connection, #connection=, #create, #initialize, #inspect, #load, #merge_attributes, #model, model, #new, #reload, #table, #to_json
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Method Details
#all ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/fog/local/models/directories.rb', line 23 def all data = Dir.entries(connection.local_root).select do |entry| entry[0...1] != '.' && ::File.directory?(connection.path_to(entry)) end.map do |entry| {:name => entry} end load(data) end |
#get(name) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/fog/local/models/directories.rb', line 32 def get(name) if ::File.directory?(connection.path_to(name)) new(:name => name) else nil end end |