Method: Stashify::Directory#write_directory

Defined in:
lib/stashify/directory.rb

#write_directory(directory) ⇒ Object

Writes the provided directory. Typically you will want to interact with this functionality through #write rather than directly, as it protects you from errors related to accidentally passing a Stashify::File value in. It is primarily implemented separately to give a more specific hook for various implementations.

The default implementation might work for you, as it iterates through #files and writes them to the new subdirectory.



100
101
102
103
# File 'lib/stashify/directory.rb', line 100

def write_directory(directory)
  subdir = self.directory(directory.name)
  directory.files.each { |file| subdir.write(file) }
end