Class: ChefFS::FileSystem::BaseFSDir

Inherits:
BaseFSObject show all
Defined in:
lib/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

#chef_object, #children, #compare_to, #create_child, #delete, #exists?, #path_for_printing, #read, #root, #write

Constructor Details

#initialize(name, parent) ⇒ BaseFSDir

Returns a new instance of BaseFSDir.



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

def initialize(name, parent)
  super
end

Instance Method Details

#can_have_child?(name, is_dir) ⇒ Boolean

Returns:

  • (Boolean)


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

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



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

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

#dir?Boolean

Returns:

  • (Boolean)


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

def dir?
  true
end