Module: PuppetStrings::Markdown::DefinedTypes
- Defined in:
- lib/puppet-strings/markdown/defined_types.rb
Class Method Summary collapse
- .contains_private? ⇒ Boolean
-
.in_dtypes ⇒ Array
List of defined types.
- .render ⇒ Object
- .toc_info ⇒ Object
Class Method Details
.contains_private? ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/puppet-strings/markdown/defined_types.rb', line 12 def self.contains_private? result = false unless in_dtypes.nil? in_dtypes.find { |type| type.private? }.nil? ? false : true end end |
.in_dtypes ⇒ Array
Returns list of defined types.
7 8 9 10 |
# File 'lib/puppet-strings/markdown/defined_types.rb', line 7 def self.in_dtypes arr = YARD::Registry.all(:puppet_defined_type).sort_by!(&:name).map!(&:to_hash) arr.map! { |a| PuppetStrings::Markdown::DefinedType.new(a) } end |
.render ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/puppet-strings/markdown/defined_types.rb', line 19 def self.render final = in_dtypes.length > 0 ? "## Defined types\n\n" : "" in_dtypes.each do |type| final << type.render unless type.private? end final end |
.toc_info ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/puppet-strings/markdown/defined_types.rb', line 27 def self.toc_info final = ["Defined types"] in_dtypes.each do |type| final.push(type.toc_info) end final end |