Class: YARD::CodeObjects::Chef::ResourceObject
- Inherits:
-
ChefObject
- Object
- YARD::CodeObjects::ClassObject
- ChefObject
- YARD::CodeObjects::Chef::ResourceObject
- Defined in:
- lib/yard-chef/code_objects/resource_object.rb
Overview
A ResourceObject represents a lightweight resource in chef. See docs.opscode.com/essentials_cookbook_lwrp.html
Instance Attribute Summary
Attributes inherited from ChefObject
Instance Method Summary collapse
-
#actions ⇒ Array<ActionObject>
Actions supported by the lightweight resource.
-
#attributes ⇒ Array<AttributeObject>
Attributes defined in the lightweight resource.
-
#initialize(namespace, name) ⇒ ResourceObject
constructor
Creates a new instance of ResourceObject.
-
#long_name ⇒ String
Constructs class name for the lightweight resource.
Methods inherited from ChefObject
#children_by_type, #cookbooks, register, register_element
Constructor Details
#initialize(namespace, name) ⇒ ResourceObject
Creates a new instance of ResourceObject.
resource belongs
40 41 42 43 |
# File 'lib/yard-chef/code_objects/resource_object.rb', line 40 def initialize(namespace, name) super(namespace, name) @providers = [] end |
Instance Method Details
#actions ⇒ Array<ActionObject>
Actions supported by the lightweight resource.
75 76 77 |
# File 'lib/yard-chef/code_objects/resource_object.rb', line 75 def actions children_by_type(:action) end |
#attributes ⇒ Array<AttributeObject>
Attributes defined in the lightweight resource.
67 68 69 |
# File 'lib/yard-chef/code_objects/resource_object.rb', line 67 def attributes children_by_type(:attribute) end |
#long_name ⇒ String
Constructs class name for the lightweight resource.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# 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(&:capitalize) "#{namespace.join('::')}::#{name}" end |