Class: Incept::Directory
- Inherits:
-
Object
- Object
- Incept::Directory
- Defined in:
- lib/incept/directory.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Directory
constructor
A new instance of Directory.
- #options ⇒ Object
- #package_name ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(path) ⇒ Directory
Returns a new instance of Directory.
8 9 10 |
# File 'lib/incept/directory.rb', line 8 def initialize(path) @path = path end |
Class Method Details
.names_for(path) ⇒ Object
4 5 6 |
# File 'lib/incept/directory.rb', line 4 def self.names_for(path) Dir.new(path).entries.reject {|d| %w(. ..).include?(d) } end |
Instance Method Details
#options ⇒ Object
16 17 18 |
# File 'lib/incept/directory.rb', line 16 def self.class.names_for(@path) end |
#package_name ⇒ Object
12 13 14 |
# File 'lib/incept/directory.rb', line 12 def package_name @path.match(%r{/([^/]+)$})[1] end |
#to_hash ⇒ Object
20 21 22 |
# File 'lib/incept/directory.rb', line 20 def to_hash {package_name => } end |