Class: HDir
- Inherits:
-
Object
- Object
- HDir
- Defined in:
- lib/hmisc/hdir.rb
Instance Method Summary collapse
-
#initialize(pathName) ⇒ HDir
constructor
A new instance of HDir.
- #onlyDirectories ⇒ Object
Constructor Details
#initialize(pathName) ⇒ HDir
Returns a new instance of HDir.
3 4 5 |
# File 'lib/hmisc/hdir.rb', line 3 def initialize(pathName) @pathName = pathName end |
Instance Method Details
#onlyDirectories ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/hmisc/hdir.rb', line 7 def onlyDirectories directories = [] Dir[@pathName].map do |file| next if File.file?(file) directories << File.basename(file) end return directories end |