RestListDir
# File lib/chef/chef_fs/file_system/data_bag_dir.rb, line 59 def _make_child_entry(name, exists = nil) DataBagItem.new(name, self, exists) end
# File lib/chef/chef_fs/file_system/data_bag_dir.rb, line 49 def create_child(name, file_contents) json = Chef::JSONCompat.from_json(file_contents).to_hash id = name[0,name.length-5] if json.include?('id') && json['id'] != id raise "ID in #{path_for_printing}/#{name} must be '#{id}' (is '#{json['id']}')" end rest.post_rest(api_path, json) _make_child_entry(name, true) end
# File lib/chef/chef_fs/file_system/data_bag_dir.rb, line 63 def delete(recurse) if !recurse raise Chef::ChefFS::FileSystem::MustDeleteRecursivelyError.new, "#{path_for_printing} must be deleted recursively" end begin rest.delete_rest(api_path) rescue Net::HTTPServerException if $!.response.code == "404" raise Chef::ChefFS::FileSystem::NotFoundError.new($!), "#{path_for_printing} not found" end end end
# File lib/chef/chef_fs/file_system/data_bag_dir.rb, line 33 def dir? exists? end
Generated with the Darkfish Rdoc Generator 2.