Class: DocumentingLWRPBase
- Inherits:
-
Chef::Resource::LWRPBase
- Object
- Chef::Resource::LWRPBase
- DocumentingLWRPBase
- Defined in:
- lib/knife_cookbook_doc/documenting_lwrp_base.rb
Constant Summary collapse
- NOT_PASSED =
defined?(::Chef::NOT_PASSED) ? ::Chef::NOT_PASSED : "NOT_PASSED"
Class Method Summary collapse
- .attribute(attr_name, validation_opts = {}) ⇒ Object
- .attribute_specifications ⇒ Object
- .desc(description) ⇒ Object
- .description ⇒ Object
- .property(name, type = NOT_PASSED, **options) ⇒ Object
Class Method Details
.attribute(attr_name, validation_opts = {}) ⇒ Object
25 26 27 28 29 |
# File 'lib/knife_cookbook_doc/documenting_lwrp_base.rb', line 25 def self.attribute(attr_name, validation_opts={}) result = super(attr_name, validation_opts) attribute_specifications[attr_name] = validation_opts result end |
.attribute_specifications ⇒ Object
6 7 8 |
# File 'lib/knife_cookbook_doc/documenting_lwrp_base.rb', line 6 def attribute_specifications @attribute_specifications ||= {} end |
.desc(description) ⇒ Object
10 11 12 |
# File 'lib/knife_cookbook_doc/documenting_lwrp_base.rb', line 10 def desc(description) @description = "#{@description}#{description}\n" end |
.description ⇒ Object
14 15 16 |
# File 'lib/knife_cookbook_doc/documenting_lwrp_base.rb', line 14 def description @description || "" end |
.property(name, type = NOT_PASSED, **options) ⇒ Object
19 20 21 22 |
# File 'lib/knife_cookbook_doc/documenting_lwrp_base.rb', line 19 def property(name, type = NOT_PASSED, **) attribute_specifications[name] = super(name, type, **) if defined?(super) end |