Module: PuppetStrings::Markdown::Functions
- Defined in:
- lib/puppet-strings/markdown/functions.rb
Class Method Summary collapse
- .contains_private? ⇒ Boolean
-
.in_functions ⇒ Array
List of functions.
- .render ⇒ Object
- .toc_info ⇒ Object
Class Method Details
.contains_private? ⇒ Boolean
14 15 16 17 18 19 |
# File 'lib/puppet-strings/markdown/functions.rb', line 14 def self.contains_private? result = false unless in_functions.nil? in_functions.find { |func| func.private? }.nil? ? false : true end end |
.in_functions ⇒ Array
Returns list of functions.
9 10 11 12 |
# File 'lib/puppet-strings/markdown/functions.rb', line 9 def self.in_functions arr = YARD::Registry.all(:puppet_function).sort_by!(&:name).map!(&:to_hash) arr.map! { |a| PuppetStrings::Markdown::Function.new(a) } end |
.render ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/puppet-strings/markdown/functions.rb', line 21 def self.render final = in_functions.length > 0 ? "## Functions\n\n" : "" in_functions.each do |func| final += func.render unless func.private? end final end |
.toc_info ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/puppet-strings/markdown/functions.rb', line 29 def self.toc_info final = ["Functions"] in_functions.each do |func| final.push(func.toc_info) end final end |