Class: YARD::CodeObjects::Chef::ResourceObject

Inherits:
ChefObject
  • Object
show all
Defined in:
lib/yard-chefdoc/code_objects/resource.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) ⇒ ResourceObject

Creates a new instance of the ResourceObject

Parameters:

  • namespace (NamespaceObject)

    namespace to which the resource belongs

  • name (String)

    name of the resource. This is the base name which chef automatically generates.



21
22
23
24
25
26
# File 'lib/yard-chefdoc/code_objects/resource.rb', line 21

def initialize(namespace, name)
  super(namespace, name)
  @resource_name = name
  @properties = []
  @actions = []
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



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

def actions
  @actions
end

#default_actionObject

Returns the value of attribute default_action.



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

def default_action
  @default_action
end

#load_current_valueObject

Returns the value of attribute load_current_value.



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

def load_current_value
  @load_current_value
end

#propertiesObject

Returns the value of attribute properties.



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

def properties
  @properties
end

#resource_nameObject

Returns the value of attribute resource_name.



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

def resource_name
  @resource_name
end

Instance Method Details

#add_action(h) ⇒ Object

Add an action as an Action object (see below)

Parameters:

  • h (Hash)

    The action hash to add



40
41
42
# File 'lib/yard-chefdoc/code_objects/resource.rb', line 40

def add_action(h)
  @actions.push(Action.new(h))
end

#add_property(h) ⇒ Object

Add a single property as an Property object (see below)

Parameters:

  • h (Hash)

    The property hash to add



32
33
34
# File 'lib/yard-chefdoc/code_objects/resource.rb', line 32

def add_property(h)
  @properties.push(Property.new(h))
end