Module: PathMapper
- Defined in:
- lib/path_mapper.rb,
lib/path_mapper/version.rb
Defined Under Namespace
Modules: BaseNode Classes: DirNode, FileNode, FilesIterator, NullNode
Constant Summary collapse
- VERSION =
'0.0.2'
Class Method Summary collapse
Class Method Details
.new(path) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/path_mapper.rb', line 4 def self.new(path) if File.exists? path if File.directory? path return DirNode.new(path) elsif !File.read(path).strip.empty? return FileNode.new(path) end end NullNode.new(path) end |