module AndFeathers::Tarball::ContainsDirectories

A module which gives instances of a class the dir DSL method

Public Instance Methods

dir(name, mode = 16877, &block) click to toggle source

Add a Directory named name to this entity’s list of children

@param name [String] the directory name @param mode [Fixnum] the directory mode

@yieldparam directory [Directory] the newly-created Directory

# File lib/and_feathers/tarball/contains_directories.rb, line 15
def dir(name, mode = 16877, &block)
  Directory.new(name, mode, self).tap do |subdir|
    block.call(subdir) if block

    @children.push(subdir)
  end
end