Class: Chef::ChefFS::FileSystem::NonexistentFSObject

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

Instance Attribute Summary

Attributes inherited from BaseFSObject

#name, #parent, #path

Instance Method Summary collapse

Methods inherited from BaseFSObject

#can_have_child?, #child, #compare_to, #dir?, #path_for_printing, #root

Constructor Details

#initialize(name, parent) ⇒ NonexistentFSObject

Returns a new instance of NonexistentFSObject.



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

def initialize(name, parent)
  super
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


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

def exists?
  false
end

#readObject



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

def read
  raise Chef::ChefFS::FileSystem::NotFoundError, "Nonexistent #{path_for_printing}"
end