summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/util/inline_docs.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/puppet/util/inline_docs.rb b/lib/puppet/util/inline_docs.rb
new file mode 100644
index 000000000..405b53945
--- /dev/null
+++ b/lib/puppet/util/inline_docs.rb
@@ -0,0 +1,29 @@
+module Puppet::Util::InlineDocs
+ def self.included(klass)
+ klass.send(:include, InstanceMethods)
+ klass.extend ClassMethods
+ end
+
+ module ClassMethods
+ attr_accessor :use_docs
+ def associates_doc
+ self.use_docs = true
+ end
+ end
+
+ module InstanceMethods
+ attr_writer :doc
+
+ def doc
+ unless defined?(@doc) and @doc
+ @doc = ""
+ end
+ @doc
+ end
+
+ # don't fetch lexer comment by default
+ def use_docs
+ self.class.use_docs
+ end
+ end
+end