Class: HDir

Inherits:
Object
  • Object
show all
Defined in:
lib/hmisc/hdir.rb

Instance Method Summary collapse

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

#onlyDirectoriesObject



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