Module: PuppetStrings::Markdown::ResourceTypes

Defined in:
lib/puppet-strings/markdown/resource_types.rb

Class Method Summary collapse

Class Method Details

.contains_private?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/puppet-strings/markdown/resource_types.rb', line 14

def self.contains_private?
  result = false
  unless in_rtypes.nil?
    in_rtypes.find { |type| type.private? }.nil? ? false : true
  end
end

.in_rtypesArray

Returns list of resource types.

Returns:

  • (Array)

    list of resource types



9
10
11
12
# File 'lib/puppet-strings/markdown/resource_types.rb', line 9

def self.in_rtypes
  arr = YARD::Registry.all(:puppet_type).sort_by!(&:name).map!(&:to_hash)
  arr.map! { |a| PuppetStrings::Markdown::ResourceType.new(a) }
end

.renderObject



21
22
23
24
25
26
27
# File 'lib/puppet-strings/markdown/resource_types.rb', line 21

def self.render
  final = in_rtypes.length > 0 ? "## Resource types\n\n" : ""
  in_rtypes.each do |type|
    final += type.render unless type.private?
  end
  final
end

.toc_infoObject



29
30
31
32
33
34
35
36
37
# File 'lib/puppet-strings/markdown/resource_types.rb', line 29

def self.toc_info
  final = ["Resource types"]

  in_rtypes.each do |type|
    final.push(type.toc_info)
  end

  final
end