class YARD::CodeObjects::Chef::CookbookObject

A CookbookObject represents a Chef cookbook. See wiki.opscode.com/display/chef/Cookbooks for more information about cookbook.

Attributes

providers[R]

Lightweight providers implemented in the cookbook.

@return [Array<ProviderObject>] lightweight providers in the cookbook

resources[R]

Lightweight resources implemented in the cookbook.

@return [Array<ResourceObject>] lightweight resources in the cookbook

short_desc[RW]

Short description for the cookbook.

@param short_desc [String] short description for the cookbook

@return [String] short description for the cookbook

version[RW]

Version of the cookbook.

@param version [String] version for the cookbook

@return [String] version for the cookbook

Public Class Methods

new(namespace, name) click to toggle source

Creates a new CookbookObject instance. @param namespace [NamespaceObject] namespace to which the cookbook belongs @param name [String] name of the cookbook

@return [CookbookObject] the newly created CookbookObject

# File lib/yard-chef/code_objects/cookbook_object.rb, line 68
def initialize(namespace, name)
  super(namespace, name)
  @resources = []
  @providers = []
  @libraries = []
end

Public Instance Methods

attributes() click to toggle source

Attributes implemented in the cookbook.

@return [Array<AttributeObject>] attributes in the cookbook

# File lib/yard-chef/code_objects/cookbook_object.rb, line 87
def attributes
  children_by_type(:attribute)
end
definitions() click to toggle source

Definitions implemented in the cookbook.

@return [Array<MethodObject>] definitions in the cookbook

# File lib/yard-chef/code_objects/cookbook_object.rb, line 95
def definitions
  children_by_type(:method)
end
dependencies() click to toggle source

Dependencies of the cookbook.

@return [Array<MethodObject>] dependencies of the cookbook

# File lib/yard-chef/code_objects/cookbook_object.rb, line 103
def dependencies
  children_by_type(:dependency)
end
libraries() click to toggle source

Libraries defined in the cookbook.

@return [Array<ModuleObject>] libraries in the cookbook

# File lib/yard-chef/code_objects/cookbook_object.rb, line 111
def libraries
  modules = YARD::Registry.all(:module)
  modules.select { |lib| lib.file.split('/').include?(@name.to_s) }
end
recipes() click to toggle source

Recipes implemented in the cookbook.

@return [Array<RecipeObject>] recipes in the cookbook

# File lib/yard-chef/code_objects/cookbook_object.rb, line 79
def recipes
  children_by_type(:recipe)
end