class YARD::CodeObjects::Chef::ResourceObject

Attributes

actions[RW]
default_action[RW]
load_current_value[RW]
properties[RW]
resource_name[RW]

Public Class Methods

new(namespace, name) click to toggle source

Creates a new instance of the ResourceObject

@param namespace [NamespaceObject] namespace to which the resource belongs @param name [String] name of the resource. This is the base name which chef

automatically generates.

@return [ResourceObject] the newly created ResourceObject

# File lib/yard-chefdoc/code_objects/resource.rb, line 21
def initialize(namespace, name)
  super(namespace, name)
  @resource_name = name
  @properties = []
  @actions = []
end

Public Instance Methods

add_action(h) click to toggle source

Add an action as an Action object (see below)

@param h [Hash] The action hash to add

# File lib/yard-chefdoc/code_objects/resource.rb, line 40
def add_action(h)
  @actions.push(Action.new(h))
end
add_property(h) click to toggle source

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

@param h [Hash] The property hash to add

# File lib/yard-chefdoc/code_objects/resource.rb, line 32
def add_property(h)
  @properties.push(Property.new(h))
end