class YARD::CodeObjects::Chef::ResourceObject

A ResourceObject represents a lightweight resource in chef. See docs.opscode.com/essentials_cookbook_lwrp.html

Public Class Methods

new(namespace, name) click to toggle source

Creates a new instance of ResourceObject.

@param namespace [NamespaceObject] namespace to which the lightweight resource belongs @param name [String] name of the lightweight resource

@return [ResourceObject] the newly created ResourceObject

Calls superclass method YARD::CodeObjects::Chef::ChefObject.new
# File lib/yard-chef/code_objects/resource_object.rb, line 40
def initialize(namespace, name)
  super(namespace, name)
  @providers = []
end

Public Instance Methods

actions() click to toggle source

Actions supported by the lightweight resource.

@return [Array<ActionObject>] actions in the lightweight resource

# File lib/yard-chef/code_objects/resource_object.rb, line 75
def actions
  children_by_type(:action)
end
attributes() click to toggle source

Attributes defined in the lightweight resource.

@return [Array<AttributeObject>] attributes in the lightweight resource

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

Constructs class name for the lightweight resource.

@return [String] class name for the lightweight resource

# File lib/yard-chef/code_objects/resource_object.rb, line 49
def long_name
  name = ''
  if @name.to_s =~ /_/
    @name.to_s.split('_').each do |str|
      name << str.to_s.capitalize
    end
  else
    name = @name.to_s.capitalize
  end

  namespace = @namespace.to_s.split('::').map { |str| str.capitalize }
  "#{namespace.join('::')}::#{name}"
end