Class: YARD::CodeObjects::Chef::AttributeObject

Inherits:
ChefObject
  • Object
show all
Defined in:
lib/yard-chefdoc/code_objects/attribute.rb

Instance Attribute Summary collapse

Attributes inherited from ChefObject

#file, #header

Instance Method Summary collapse

Methods inherited from ChefObject

#chef_init, #children_by_type, #find_description_in, #find_header_in, register, register_element

Constructor Details

#initialize(namespace, name) ⇒ AttributeObject

Creates a new instance of the AttributeObject which represents a file in the attributes directory.

Parameters:

  • namespace (NamespaceObject)

    namespace to which the attribute belongs

  • name (String)

    name of the attribute file



17
18
19
20
# File 'lib/yard-chefdoc/code_objects/attribute.rb', line 17

def initialize(namespace, name)
  super(namespace, name)
  @attributes = []
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



7
8
9
# File 'lib/yard-chefdoc/code_objects/attribute.rb', line 7

def attributes
  @attributes
end

Instance Method Details

#add(h) ⇒ Object

Add a single attribute as an Attribute object (see below)

Parameters:

  • h (Hash)

    The attribute hash to add



26
27
28
# File 'lib/yard-chefdoc/code_objects/attribute.rb', line 26

def add(h)
  @attributes.push(Attribute.new(h))
end