diff options
author | Thom May <thom@chef.io> | 2018-02-07 11:52:15 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2018-02-12 17:36:19 +0000 |
commit | d6579dfbfee821fca6d8bcbade001fbdb8522300 (patch) | |
tree | 17dbfbca94c5d99f37fcdde599786bda06abe64e /lib/chef/resource.rb | |
parent | 5401a701f1e40f41e76ff855aa4c6dbf411dd230 (diff) | |
download | chef-d6579dfbfee821fca6d8bcbade001fbdb8522300.tar.gz |
allow resources to be documented
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r-- | lib/chef/resource.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb index ac1146a647..0351f6231e 100644 --- a/lib/chef/resource.rb +++ b/lib/chef/resource.rb @@ -1174,8 +1174,8 @@ class Chef # Internal Resource Interface (for Chef) # - FORBIDDEN_IVARS = [:@run_context, :@not_if, :@only_if, :@enclosing_provider] - HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@not_if, :@only_if, :@elapsed_time, :@enclosing_provider] + FORBIDDEN_IVARS = [:@run_context, :@not_if, :@only_if, :@enclosing_provider, :@description, :@introduced, :@examples] + HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@not_if, :@only_if, :@elapsed_time, :@enclosing_provider, :@description, :@introduced, :@examples] include Chef::Mixin::ConvertToClassName extend Chef::Mixin::ConvertToClassName @@ -1374,6 +1374,27 @@ class Chef end end + def self.description(description = "NOT_PASSED") + if description != "NOT_PASSED" + @description = description + end + @description + end + + def self.introduced(introduced = "NOT_PASSED") + if introduced != "NOT_PASSED" + @introduced = introduced + end + @introduced + end + + def self.examples(examples = "NOT_PASSED") + if examples != "NOT_PASSED" + @examples = examples + end + @examples + end + # # The cookbook in which this Resource was defined (if any). # |