Class: Chef::ChefFS::FileSystem::BaseFSDir

Inherits:
BaseFSObject show all
Defined in:
lib/chef/chef_fs/file_system/base_fs_dir.rb

Instance Attribute Summary

Attributes inherited from BaseFSObject

#name, #parent, #path

Instance Method Summary collapse

Methods inherited from BaseFSObject

#compare_to, #exists?, #path_for_printing, #root

Constructor Details

#initialize(name, parent) ⇒ BaseFSDir

Returns a new instance of BaseFSDir.



26
27
28
# File 'lib/chef/chef_fs/file_system/base_fs_dir.rb', line 26

def initialize(name, parent)
  super
end

Instance Method Details

#can_have_child?(name, is_dir) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/chef/chef_fs/file_system/base_fs_dir.rb', line 39

def can_have_child?(name, is_dir)
  true
end

#child(name) ⇒ Object

Override child(name) to provide a child object by name without the network read



35
36
37
# File 'lib/chef/chef_fs/file_system/base_fs_dir.rb', line 35

def child(name)
  children.select { |child| child.name == name }.first || NonexistentFSObject.new(name, self)
end

#dir?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/chef/chef_fs/file_system/base_fs_dir.rb', line 30

def dir?
  true
end