Class: Chef::ChefFS::FileSystem::ChefServer::DataBagDir
- Inherits:
-
RestListDir
show all
- Defined in:
- lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb
Instance Attribute Summary
Attributes inherited from RestListDir
#api_path, #data_handler
Attributes inherited from BaseFSObject
#name, #parent, #path
Instance Method Summary
collapse
Methods inherited from RestListDir
#can_have_child?, #children, #create_child, #environment, #org, #rest
Methods inherited from BaseFSDir
#can_have_child?, #empty?
#can_have_child?, #chef_object, #child, #children, #compare_to, #create_child, #path_for_printing, #root, #write
Constructor Details
#initialize(name, parent, exists = nil) ⇒ DataBagDir
Returns a new instance of DataBagDir.
29
30
31
32
|
# File 'lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb', line 29
def initialize(name, parent, exists = nil)
super(name, parent, nil, Chef::ChefFS::DataHandler::DataBagItemDataHandler.new)
@exists = nil
end
|
Instance Method Details
#delete(recurse) ⇒ Object
#dir? ⇒ Boolean
34
35
36
|
# File 'lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb', line 34
def dir?
exists?
end
|
#exists? ⇒ Boolean
43
44
45
46
47
48
|
# File 'lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb', line 43
def exists?
if @exists.nil?
@exists = parent.children.any? { |child| child.name == name }
end
@exists
end
|
#make_child_entry(name, exists = nil) ⇒ Object
69
70
71
72
|
# File 'lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb', line 69
def make_child_entry(name, exists = nil)
@children.find { |child| child.name == name } if @children
DataBagEntry.new(name, self, exists)
end
|