Class: Chef::ChefFS::FileSystem::OrgEntry

Inherits:
RestListEntry show all
Defined in:
lib/chef/chef_fs/file_system/org_entry.rb

Overview

/organizations/NAME/org.json Represents the actual data at /organizations/NAME (the full name, etc.)

Instance Attribute Summary

Attributes inherited from BaseFSObject

#name, #parent, #path

Instance Method Summary collapse

Methods inherited from RestListEntry

#_read_json, #api_child_name, #api_error_text, #chef_object, #compare_to, #environment, #minimize_value, #org, #read, #rest, #write

Methods inherited from BaseFSObject

#can_have_child?, #chef_object, #child, #children, #compare_to, #create_child, #dir?, #path_for_printing, #read, #root, #write

Constructor Details

#initialize(name, parent, exists = nil) ⇒ OrgEntry

Returns a new instance of OrgEntry.



10
11
12
13
# File 'lib/chef/chef_fs/file_system/org_entry.rb', line 10

def initialize(name, parent, exists = nil)
  super(name, parent)
  @exists = exists
end

Instance Method Details

#api_pathObject

/organizations/foo/org.json -> GET /organizations/foo



20
21
22
# File 'lib/chef/chef_fs/file_system/org_entry.rb', line 20

def api_path
  parent.api_path
end

#data_handlerObject



15
16
17
# File 'lib/chef/chef_fs/file_system/org_entry.rb', line 15

def data_handler
  Chef::ChefFS::DataHandler::OrganizationDataHandler.new
end

#delete(recurse) ⇒ Object



28
29
30
# File 'lib/chef/chef_fs/file_system/org_entry.rb', line 28

def delete(recurse)
  raise Chef::ChefFS::FileSystem::OperationNotAllowedError.new(:delete, self)
end

#exists?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/chef/chef_fs/file_system/org_entry.rb', line 24

def exists?
  parent.exists?
end