Class: Chef::ChefFS::FileSystem::ChefServer::EnvironmentsDir::DefaultEnvironmentEntry
- Inherits:
-
RestListEntry
- Object
- BaseFSObject
- RestListEntry
- Chef::ChefFS::FileSystem::ChefServer::EnvironmentsDir::DefaultEnvironmentEntry
- Defined in:
- lib/chef/chef_fs/file_system/chef_server/environments_dir.rb
Instance Attribute Summary
Attributes inherited from BaseFSObject
Instance Method Summary collapse
- #delete(recurse) ⇒ Object
-
#initialize(name, parent, exists = nil) ⇒ DefaultEnvironmentEntry
constructor
A new instance of DefaultEnvironmentEntry.
- #write(file_contents) ⇒ Object
Methods inherited from RestListEntry
#_read_json, #api_child_name, #api_error_text, #api_path, #chef_object, #compare_to, #data_handler, #display_name, #display_path, #environment, #exists?, #minimize_value, #normalize_value, #org, #read, #rest
Methods inherited from BaseFSObject
#can_have_child?, #chef_object, #child, #children, #compare_to, #create_child, #dir?, #exists?, #path_for_printing, #read, #root
Constructor Details
#initialize(name, parent, exists = nil) ⇒ DefaultEnvironmentEntry
Returns a new instance of DefaultEnvironmentEntry.
37 38 39 40 |
# File 'lib/chef/chef_fs/file_system/chef_server/environments_dir.rb', line 37 def initialize(name, parent, exists = nil) super(name, parent) @exists = exists end |
Instance Method Details
#delete(recurse) ⇒ Object
42 43 44 45 46 |
# File 'lib/chef/chef_fs/file_system/chef_server/environments_dir.rb', line 42 def delete(recurse) raise NotFoundError.new(self) unless exists? raise DefaultEnvironmentCannotBeModifiedError.new(:delete, self) end |
#write(file_contents) ⇒ Object
48 49 50 51 52 |
# File 'lib/chef/chef_fs/file_system/chef_server/environments_dir.rb', line 48 def write(file_contents) raise NotFoundError.new(self) unless exists? raise DefaultEnvironmentCannotBeModifiedError.new(:write, self) end |