Module: PuppetStrings::Markdown::PuppetClasses

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

Class Method Summary collapse

Class Method Details

.contains_private?Boolean

Returns:

  • (Boolean)


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

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

.in_classesArray

Returns list of classes.

Returns:

  • (Array)

    list of classes



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

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

.renderObject



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

def self.render
  final = in_classes.length > 0 ? "## Classes\n\n" : ""
  in_classes.each do |klass|
    final += klass.render unless klass.private?
  end
  final
end

.toc_infoObject



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

def self.toc_info
  final = ["Classes"]

  in_classes.each do |klass|
    final.push(klass.toc_info)
  end

  final
end