Class: FileSetWorks::FilesetItem

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

Direct Known Subclasses

Directory, File

Instance Method Summary collapse

Constructor Details

#initialize(path, populator = default_populator()) ⇒ FilesetItem

Returns a new instance of FilesetItem.



84
85
86
87
# File 'lib/fileset.rb', line 84

def initialize(path, populator = default_populator())
  @path = path
  @populator = populator
end

Instance Method Details

#create_in(search_path) ⇒ Object



97
98
99
100
101
# File 'lib/fileset.rb', line 97

def create_in(search_path)
  path = ::File::join(search_path, @path)
  return if ::File::exists?(path)
  init_self(path)
end

#default_populatorObject



89
90
91
# File 'lib/fileset.rb', line 89

def default_populator
  Population::LowestPath
end

#populate(search_paths) ⇒ Object



93
94
95
# File 'lib/fileset.rb', line 93

def populate(search_paths)
  @populator.new(self, search_paths).populate
end